mirror of
https://github.com/NaN-tic/trytond-galatea_tutorial.git
synced 2023-12-14 02:32:55 +01:00
Total Comments Field
This commit is contained in:
parent
05cdc7480b
commit
6560e04196
1 changed files with 5 additions and 0 deletions
|
@ -46,6 +46,8 @@ class GalateaTutorial(ModelSQL, ModelView):
|
|||
gallery = fields.Boolean('Gallery', help='Active gallery attachments.')
|
||||
comment = fields.Boolean('Comment', help='Active comments.')
|
||||
comments = fields.One2Many('galatea.tutorial.comment', 'tutorial', 'Comments')
|
||||
total_comments = fields.Function(fields.Integer("Total Comments"),
|
||||
'get_totalcomments')
|
||||
attachments = fields.One2Many('ir.attachment', 'resource', 'Attachments')
|
||||
_slug_langs_cache = Cache('galatea_tutorial.slug_langs')
|
||||
|
||||
|
@ -148,6 +150,9 @@ class GalateaTutorial(ModelSQL, ModelView):
|
|||
|
||||
return slugs
|
||||
|
||||
def get_totalcomments(self, name):
|
||||
return len(self.comments)
|
||||
|
||||
|
||||
class GalateaTutorialWebSite(ModelSQL):
|
||||
'Galatea Tutorial - Website'
|
||||
|
|
Loading…
Reference in a new issue