Revision a6da4134 cloudcmsfaq/models.py
b/cloudcmsfaq/models.py | ||
---|---|---|
69 | 69 |
image = MediaFileForeignKey(MediaFile, blank=True, null=True) |
70 | 70 |
class_name = models.CharField(_('class_name'), max_length=200, blank=True, null=True) |
71 | 71 |
|
72 |
def faqs_count(self): |
|
73 |
return self.faqs.count() |
|
74 |
|
|
72 | 75 |
class Meta: |
73 | 76 |
verbose_name = _('category') |
74 | 77 |
verbose_name_plural = _('categories') |
75 | 78 |
ordering = ['ordering',] |
76 | 79 |
|
77 | 80 |
objects = translations.TranslatedObjectManager() |
78 |
|
|
79 |
|
|
81 |
|
|
82 |
|
|
80 | 83 |
def __unicode__(self): |
81 | 84 |
trans = translations.TranslatedObjectMixin.__unicode__(self) |
82 | 85 |
return trans or _('Unnamed category') |
... | ... | |
163 | 166 |
|
164 | 167 |
def get_previous(self): |
165 | 168 |
return self.get_previous_by_published_on(category=self.category, service=self.service) |
166 |
|
|
169 |
|
|
167 | 170 |
def get_absolute_url(self): |
168 | 171 |
try: |
169 | 172 |
r = reverse('cloudcmsfaq_question_detail', 'cloudcmsfaq.urls', (), |
Also available in: Unified diff