I have a django project with 'news' applications. here is the model:
class News(models.Model):
title = CharField(max_length=255)
content = TextField()
How can I add django-cms to this project to be able modify news directly in template? I know I need a custom plugin based on 'news' model, and here I have two choices: 1) I can describe all fields of 'news' model in single plugin, but then there will be a window to edit all fields at once.
plugin, that describes all fields:
class NewsPlugin(CMSPlugin):
title = CharField(max_length=255)
content = TextField()
def __unicode__(self):
return self.title
2) The second idea is about to write plugins for each separate field in 'news' and combine them in some another plugin, but I dont know how to realize it.
separate plugin for news title:
class NewsTitle(CMSPlugin):
title = CharField(max_length=255)
separate pluginn for news content:
class NewsContent(CMSPlugin):
content = TextField()
Any idea?