Bases: django.db.models.base.Model
Article(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.
NB! This generator is expensive, so use it with care!!
NB! This generator is expensive, so use it with care!!
Returns cached
NB! This generator is expensive, so use it with care!!
Bases: django.db.models.base.Model
ArticleForObject(id, article_id, content_type_id, object_id, is_mptt)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Provides a generic relation to any object through content-type/object-id fields.
Bases: 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.
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: 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: django.db.models.base.Model
This is the mother of all plugins. Extending from it means a deletion of an article will CASCADE to your plugin, and the database will be kept clean. Furthermore, it’s possible to list all plugins and maintain generic properties in the future...
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Remove related contents completely, ie. media files.
Bases: models.pluginbase.ArticlePlugin
Extend from this model if you have a plugin that may be related to many articles. Please note that the ArticlePlugin.article ForeignKey STAYS! This is in order to maintain an explicit set of permissions.
In general, it’s quite complicated to maintain plugin content that’s shared between different articles. The best way to go is to avoid this. For inspiration, look at wiki.plugins.attachments
You might have to override the permission methods (can_read, can_write etc.) if you have certain needs for logic in your reusable plugin.
Bases: models.pluginbase.DoesNotExist
Bases: models.pluginbase.MultipleObjectsReturned
Bases: models.pluginbase.ArticlePlugin
If you want your plugin to maintain revisions, extend from this one, not SimplePlugin.
This kind of plugin is not attached to article plugins so rolling articles back and forth does not affect it.
Bases: models.pluginbase.DoesNotExist
Bases: models.pluginbase.MultipleObjectsReturned
Sets the properties of a revision and ensures its the current revision.
Bases: models.article.BaseRevisionMixin, django.db.models.base.Model
If you want your plugin to maintain revisions, make an extra model that extends from this one.
(this class is very much copied from wiki.models.article.ArticleRevision
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: models.pluginbase.ArticlePlugin
Inherit from this model and make sure to specify an article when saving a new instance. This way, a new revision will be created, and users are able to roll back to the a previous revision (in which your plugin wasn’t related to the article).
Furthermore, your plugin relation is kept when new revisions are created.
Usage:
Creating new plugins instances: YourPlugin(article=article_instance, ...) or YourPlugin.objects.create(article=article_instance, ...)
Bases: models.pluginbase.DoesNotExist
Bases: models.pluginbase.MultipleObjectsReturned
Bases: exceptions.Exception
Every time a new article revision is created, we update all active plugins to match this article revision
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.