forked from 0x2620/pandora
add getAnnotation, fixes #2572
This commit is contained in:
parent
1ac959623e
commit
d6c10eb377
2 changed files with 29 additions and 1 deletions
|
|
@ -110,6 +110,10 @@ class Annotation(models.Model):
|
|||
return True
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def get(cls, id):
|
||||
return cls.objects.get(public_id=id)
|
||||
|
||||
def set_public_id(self):
|
||||
if self.id:
|
||||
public_id = Annotation.objects.filter(item=self.item, id__lt=self.id).count() + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue