switched tag field to local TagTreeModel
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
from django.contrib.gis.db import models
|
||||
|
||||
from tagulous.models import TagField
|
||||
# from core.models import TreeTag
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
||||
@@ -131,3 +131,7 @@ class Command(BaseCommand):
|
||||
logging.info(f"Region instances created: {region_counter}")
|
||||
logging.info(f"Province instances created: {province_counter}")
|
||||
logging.info(f"City instances created: {city_counter}")
|
||||
print(f"Country instances created: {country_counter}")
|
||||
print(f"Region instances created: {region_counter}")
|
||||
print(f"Province instances created: {province_counter}")
|
||||
print(f"City instances created: {city_counter}")
|
||||
|
||||
@@ -76,6 +76,7 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
|
||||
|
||||
class TreeTag(TagTreeModel):
|
||||
class TagMeta:
|
||||
# initial = "food/eating, food/cooking, gaming/football"
|
||||
initial = ""
|
||||
force_lowercase = True
|
||||
max_count=20
|
||||
# autocomplete_view = 'myapp.views.hobbies_autocomplete'
|
||||
|
||||
@@ -2,6 +2,7 @@ from django.contrib.gis.db import models
|
||||
|
||||
from tagulous.models import SingleTagField, TagField, TagTreeModel
|
||||
|
||||
from core.models import TreeTag
|
||||
from companies.models import Company
|
||||
|
||||
# Create your models here.
|
||||
@@ -33,9 +34,9 @@ class Product(models.Model):
|
||||
update_date = models.DateTimeField('Fecha de actualización de producto', null=True, blank=True)
|
||||
discount = models.DecimalField('Descuento', max_digits=5, decimal_places=2, null=True, blank=True)
|
||||
stock = models.PositiveIntegerField('Stock', null=True)
|
||||
tags = TagField(force_lowercase=True, max_count=20, tree=True)
|
||||
tags = TagField(to=TreeTag)
|
||||
category = SingleTagField(null=True) # main tag category
|
||||
attributes = TagField(force_lowercase=True, max_count=20, tree=True)
|
||||
attributes = TagField(to=TreeTag, related_name='product_attributes')
|
||||
identifiers = models.TextField('Identificador único de producto', null=True, blank=True)
|
||||
|
||||
# internal
|
||||
|
||||
Reference in New Issue
Block a user