2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-16 09:46:31 +00:00

Reverse lookup for part category URL

- Added some test cases for PartCategory model
This commit is contained in:
Oliver Walters
2019-04-25 00:28:40 +10:00
parent a2d4403968
commit f9db3b680d
3 changed files with 71 additions and 3 deletions

View File

@@ -74,9 +74,9 @@ class InvenTreeTree(models.Model):
@property
def children(self):
contents = ContentType.objects.get_for_model(type(self))
children = contents.get_all_objects_for_this_type(parent=self.id)
childs = contents.get_all_objects_for_this_type(parent=self.id)
return children
return childs
def getAcceptableParents(self):
""" Returns a list of acceptable parent items within this model