mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Minor fix to example app
This commit is contained in:
parent
3074728ac3
commit
0e7e7bbbf4
1 changed files with 8 additions and 8 deletions
|
|
@ -1,28 +1,28 @@
|
|||
from django.db import models
|
||||
|
||||
from categories.models import CategoryBase
|
||||
from categories.base import CategoryBase
|
||||
|
||||
class SimpleText(models.Model):
|
||||
"""
|
||||
(SimpleText description)
|
||||
"""
|
||||
|
||||
|
||||
name = models.CharField(max_length=255)
|
||||
description = models.TextField(blank=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'Simple Text'
|
||||
ordering = ('-created',)
|
||||
get_latest_by = 'updated'
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
# If using the get_absolute_url method, put the following line at the top of this file:
|
||||
from django.db.models import permalink
|
||||
|
||||
|
||||
@permalink
|
||||
def get_absolute_url(self):
|
||||
return ('simpletext_detail_view_name', [str(self.id)])
|
||||
|
|
@ -31,9 +31,9 @@ class SimpleCategory(CategoryBase):
|
|||
"""A Test of catgorizing"""
|
||||
class Meta:
|
||||
verbose_name_plural = 'simple categories'
|
||||
|
||||
|
||||
|
||||
#import categories
|
||||
|
||||
#categories.register_fk(SimpleText, 'primary_category', {'related_name':'simpletext_primary_set'})
|
||||
#categories.register_m2m(SimpleText, 'cats', )
|
||||
#categories.register_m2m(SimpleText, 'cats', )
|
||||
|
|
|
|||
Loading…
Reference in a new issue