mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 04:25:42 +00:00
Annotate models with their API list view
- It will make sense, trust me
This commit is contained in:
@ -60,6 +60,10 @@ class Build(MPTTModel):
|
||||
responsible: User (or group) responsible for completing the build
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def get_api_url():
|
||||
return reverse('api-build-list')
|
||||
|
||||
OVERDUE_FILTER = Q(status__in=BuildStatus.ACTIVE_CODES) & ~Q(target_date=None) & Q(target_date__lte=datetime.now().date())
|
||||
|
||||
class Meta:
|
||||
@ -1117,6 +1121,10 @@ class BuildItem(models.Model):
|
||||
quantity: Number of units allocated
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def get_api_url():
|
||||
return reverse('api-build-item-list')
|
||||
|
||||
def get_absolute_url(self):
|
||||
# TODO - Fix!
|
||||
return '/build/item/{pk}/'.format(pk=self.id)
|
||||
|
Reference in New Issue
Block a user