entity names are only unique by type
This commit is contained in:
parent
e61f742d3e
commit
d492619be6
3 changed files with 5 additions and 5 deletions
|
|
@ -63,8 +63,8 @@ class Entity(models.Model):
|
|||
return cls.objects.get(pk=ox.fromAZ(id))
|
||||
|
||||
@classmethod
|
||||
def get_by_name(cls, name):
|
||||
return cls.objects.get(name_find__icontains=u'|%s|'%name)
|
||||
def get_by_name(cls, name, type):
|
||||
return cls.objects.get(name_find__icontains=u'|%s|'%name, type=type)
|
||||
|
||||
@classmethod
|
||||
def get_or_create(model, name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue