google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add a mechanism to allow management of templates list through the admin interface. #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just took a stab at it here:
http://github.com/jbeaurain/django-page-cms/commit/433920d10d62fa2d6b79c41087d27
3ddf2dd48cf

This allows me to make a model like this to achieve the desired results:

class PageTemplate(OrderedModel):
    name = models.CharField(unique=True, max_length=100)
    template = models.CharField(unique=True, max_length=260)

    @staticmethod
    def get_page_templates():
        return PageTemplate.objects.values_list('template', 'name')

    class Meta:
        ordering = ["order"]

    def __unicode__(self):
        return self.name

Original issue reported on code.google.com by jacques....@gmail.com on 7 Jan 2010 at 4:53

GoogleCodeExporter commented 9 years ago
Merged into the master. I will have a look at that today if possible

Original comment by batiste....@gmail.com on 11 Jan 2010 at 9:01

GoogleCodeExporter commented 9 years ago

Original comment by batiste....@gmail.com on 14 Jan 2010 at 12:33