##// END OF EJS Templates
Allow linked tags to have cyclic dependancies
Pavel Ryapolov -
r286:ad629f57 default
parent child Browse files
Show More
@@ -188,18 +188,20 b' class Tag(models.Model):'
188
188
189 return reply_count
189 return reply_count
190
190
191 def get_linked_tags(self):
191 def get_linked_tags(self, tag_list=[]):
192 linked_tags = []
192 """
193 Returns the list of tags linked to current. The list can be got
194 through returned value or tag_list parameter
195 """
193
196
194 linked_tag = self.linked
197 linked_tag = self.linked
195 if linked_tag:
198
196 linked_tags.append(linked_tag)
199 if linked_tag and not (linked_tag in tag_list):
200 tag_list.append(linked_tag)
197
201
198 far_tags = linked_tag.get_linked_tags()
202 linked_tag.get_linked_tags(tag_list)
199 if len(far_tags) > 0:
200 linked_tags.extend(far_tags)
201
203
202 return linked_tags
204 return tag_list
203
205
204
206
205 class Post(models.Model):
207 class Post(models.Model):
General Comments 0
You need to be logged in to leave comments. Login now