Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added documentation to both docstrings and the proper manual, hopeful…
…ly closing #647
- Loading branch information
1 parent
6e60864
commit ef1cfa0
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,9 +72,11 @@ Now models.py looks like the following:: | |
gallery = models.ForeignKey(Gallery) | ||
|
||
|
||
.. note:: | ||
.. warning:: | ||
|
||
Unfortunately `CMSPlugin` subclasses cannot be further subclassed. | ||
Two limitations apply when subclassing the `CMSPlugin` class to use with | ||
your custom plugins: the resulting subclass cannot be further subclassed, | ||
and subclasses of `CMSPlugin` cannot have a field called "text". | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chrisglass
Author
Contributor
|
||
|
||
|
||
|
||
|
This doesn't only apply to
text
, but alsolink
,file
,picture
,video
, and more, depending on which plugins are activated in the settings. The source of the problem is that inheritance in Django usesOneToOneField
s which in turn automatically generate accessors for the reverse relation on the base class. And these reverse relation accessors are of course inherited by all the plugins.It's possible to suppress the automatic generation of the reverse accessors (see http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name), but I don't know if it's possible to do this for the implicit
OneToOneField
generated by inheritance, or if it's even desirable.