2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 02:55:41 +00:00

Annotate models with their API list view

- It will make sense, trust me
This commit is contained in:
Oliver
2021-06-25 00:17:58 +10:00
parent b273dc613b
commit 04374c71c2
12 changed files with 153 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import datetime
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.core.validators import FileExtensionValidator, MinValueValidator
from django.core.exceptions import ValidationError, FieldError
@ -237,6 +238,10 @@ class StockItemLabel(LabelTemplate):
Template for printing StockItem labels
"""
@staticmethod
def get_api_url():
return reverse('api-stockitem-label-list')
SUBDIR = "stockitem"
filters = models.CharField(
@ -290,6 +295,10 @@ class StockLocationLabel(LabelTemplate):
Template for printing StockLocation labels
"""
@staticmethod
def get_api_url():
return reverse('api-stocklocation-label-list')
SUBDIR = "stocklocation"
filters = models.CharField(