Bases: django.db.models.base.Model
This is an abstract model used as a mixin: Do not override any of the core model methods but respect the inheritor’s freedom to do so itself.
Bases: exceptions.Exception
Every time a new article revision is created, we update all active plugins to match this article revision
Bases: django.db.models.base.Model
Section(id, current_revision_id, deleted, locked, created, modified, owner_id, group_id, group_read, group_write, other_read, other_write)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Sets the properties of a revision and ensures its the current revision.
Returns cached
Bases: mptt.models.MPTTModel
SectionNode(id, parent_id, section_id, article_id, slug)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: wiki.models.article.BaseRevisionMixin, django.db.models.base.Model
This is where main revision data is stored. To make it easier to copy, do NEVER create m2m relationships.
SectionRevision is directly copied from ArticleRevision.
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Inherit certain properties from predecessor because it’s very convenient. Remember to always call this method before setting properties :)
Bases: mptt.models.MPTTModel
Strategy: Very few fields go here, as most has to be managed through an article’s revision. As a side-effect, the URL resolution remains slim and swift.
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.
This returns the ancestors of this urlpath. These ancestors are hopefully cached from the article path lookup. Accessing a foreign key included in add_selecte_related on one of these ancestors will not occur an additional sql query, as they were retrieved with a select_related.
If the cached ancestors were not set explicitly, they will be retrieved from the database.
Utility function: Create a new urlpath with an article and a new revision for the article
NB! This deletes this urlpath, its children, and ALL of the related articles. This is a purged delete and CANNOT be undone.
Strategy: Don’t handle all kinds of weird cases. Be strict. Accepts paths both starting with and without ‘/’
Returns True if this article or any of its ancestors have been deleted
Now this is a crazy and silly hack, but it is basically here to enforce that an empty path always takes precedence over an article_id such that the root article doesn’t get resolved to /ID/ but /.
Another crazy hack that this supports is transforming every wiki url by a function. If _transform_url is set on this function, it will return the result of calling reverse._transform_url(reversed_url) for every url in the wiki namespace.