mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Add 'default_keywords' field to a category
This commit is contained in:
parent
02033c2157
commit
0842bd5833
@ -119,7 +119,8 @@ class EditCategoryForm(HelperForm):
|
|||||||
'parent',
|
'parent',
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
'default_location'
|
'default_location',
|
||||||
|
'default_keywords',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2 on 2019-05-14 07:27
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0023_part_keywords'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='partcategory',
|
||||||
|
name='default_keywords',
|
||||||
|
field=models.CharField(blank=True, help_text='Default keywords for parts in this category', max_length=250),
|
||||||
|
),
|
||||||
|
]
|
@ -37,6 +37,12 @@ from company.models import Company
|
|||||||
|
|
||||||
class PartCategory(InvenTreeTree):
|
class PartCategory(InvenTreeTree):
|
||||||
""" PartCategory provides hierarchical organization of Part objects.
|
""" PartCategory provides hierarchical organization of Part objects.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
name: Name of this category
|
||||||
|
parent: Parent category
|
||||||
|
default_location: Default storage location for parts in this category or child categories
|
||||||
|
default_keywords: Default keywords for parts created in this category
|
||||||
"""
|
"""
|
||||||
|
|
||||||
default_location = models.ForeignKey(
|
default_location = models.ForeignKey(
|
||||||
@ -46,6 +52,8 @@ class PartCategory(InvenTreeTree):
|
|||||||
help_text='Default location for parts in this category'
|
help_text='Default location for parts in this category'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
default_keywords = models.CharField(blank=True, max_length=250, help_text='Default keywords for parts in this category')
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('category-detail', kwargs={'pk': self.id})
|
return reverse('category-detail', kwargs={'pk': self.id})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user