mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Move Meta class to top of class definition (#4363)
This commit is contained in:
@ -180,6 +180,10 @@ class ReportTemplateBase(ReportBase):
|
||||
Able to be passed context data
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options. Abstract ensures no database table is created."""
|
||||
abstract = True
|
||||
|
||||
# Pass a single top-level object to the report template
|
||||
object_to_print = None
|
||||
|
||||
@ -255,11 +259,6 @@ class ReportTemplateBase(ReportBase):
|
||||
help_text=_('Report template is enabled'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options. Abstract ensures no database table is created."""
|
||||
|
||||
abstract = True
|
||||
|
||||
|
||||
class TestReport(ReportTemplateBase):
|
||||
"""Render a TestReport against a StockItem object."""
|
||||
|
@ -10,8 +10,6 @@ from .models import (BillOfMaterialsReport, BuildReport, PurchaseOrderReport,
|
||||
class TestReportSerializer(InvenTreeModelSerializer):
|
||||
"""Serializer class for the TestReport model"""
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options."""
|
||||
|
||||
@ -25,12 +23,12 @@ class TestReportSerializer(InvenTreeModelSerializer):
|
||||
'enabled',
|
||||
]
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
|
||||
class BuildReportSerializer(InvenTreeModelSerializer):
|
||||
"""Serializer class for the BuildReport model"""
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options."""
|
||||
|
||||
@ -44,10 +42,11 @@ class BuildReportSerializer(InvenTreeModelSerializer):
|
||||
'enabled',
|
||||
]
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
|
||||
class BOMReportSerializer(InvenTreeModelSerializer):
|
||||
"""Serializer class for the BillOfMaterialsReport model"""
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options."""
|
||||
@ -62,10 +61,11 @@ class BOMReportSerializer(InvenTreeModelSerializer):
|
||||
'enabled',
|
||||
]
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
|
||||
class PurchaseOrderReportSerializer(InvenTreeModelSerializer):
|
||||
"""Serializer class for the PurchaseOrdeReport model"""
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options."""
|
||||
@ -80,10 +80,11 @@ class PurchaseOrderReportSerializer(InvenTreeModelSerializer):
|
||||
'enabled',
|
||||
]
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
|
||||
class SalesOrderReportSerializer(InvenTreeModelSerializer):
|
||||
"""Serializer class for the SalesOrderReport model"""
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
||||
class Meta:
|
||||
"""Metaclass options."""
|
||||
@ -97,3 +98,5 @@ class SalesOrderReportSerializer(InvenTreeModelSerializer):
|
||||
'filters',
|
||||
'enabled',
|
||||
]
|
||||
|
||||
template = InvenTreeAttachmentSerializerField(required=True)
|
||||
|
Reference in New Issue
Block a user