popular categories
This commit is contained in:
@@ -6,6 +6,11 @@ from companies.models import Company
|
||||
|
||||
# Create your models here.
|
||||
|
||||
def categoryimage_path(instance, filename):
|
||||
"""Add the instance's id to the path
|
||||
"""
|
||||
return f"category/{instance.id}/{filename}"
|
||||
|
||||
class TreeTag(TagTreeModel):
|
||||
class TagMeta:
|
||||
initial = ""
|
||||
@@ -17,6 +22,7 @@ class TreeTag(TagTreeModel):
|
||||
|
||||
class CategoryTag(TagTreeModel):
|
||||
official = models.BooleanField('Oficial', default=False)
|
||||
image = models.ImageField('Imagen de la categoría', upload_to='categories/', null=True, blank=True)
|
||||
class TagMeta:
|
||||
initial = ""
|
||||
force_lowercase = False
|
||||
|
||||
Reference in New Issue
Block a user