![]() title # create_plugin_base does nothing outlandish, it only defines an # abstract base model with the following attributes: # - a parent ForeignKey with a related_name that is guaranteed to # not clash # - a region CharField containing the region key defined above # - an ordering IntegerField for ordering plugin items # - a get_queryset() classmethod returning a queryset for the # Contents class and its helpers (a good place to add # select_related and # prefetch_related calls or anything # similar) # That's all. regions = def _str_ ( self ): return self. ![]() Our example hardcodes regions if you need # different regions depending on other factors have a look at # feincms3's TemplateMixin. DateField ( blank = True, null = True ) # The ContentEditor requires a "regions" attribute or property # on the model. CharField ( max_length = 200 ) pub_date = models. ![]() From django.db import models from content_editor.models import Region, create_plugin_base class Article ( models. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |