Commit 9b1a2d9b authored by David Haynes's avatar David Haynes 🙆
Browse files

Remove labels

Closes #99
parent 848f58b2
Pipeline #3725 passed with stage
in 1 minute and 4 seconds
# Generated by Django 2.0.10 on 2019-01-26 18:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='stupidlabelhack',
name='content_type',
),
migrations.RemoveField(
model_name='stupidlabelhack',
name='tag',
),
migrations.RemoveField(
model_name='facility',
name='facility_labels',
),
migrations.DeleteModel(
name='StupidFacilityLabelHack',
),
migrations.DeleteModel(
name='StupidLabelHack',
),
]
...@@ -22,7 +22,6 @@ from django.utils import timezone ...@@ -22,7 +22,6 @@ from django.utils import timezone
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from autoslug import AutoSlugField from autoslug import AutoSlugField
from taggit.managers import TaggableManager from taggit.managers import TaggableManager
from taggit.models import GenericTaggedItemBase, TagBase
class Category(TimeStampedModel): class Category(TimeStampedModel):
...@@ -97,22 +96,6 @@ class Location(TimeStampedModel): ...@@ -97,22 +96,6 @@ class Location(TimeStampedModel):
) )
# Look I didn't want to do this but APPARENTLY you cannot have two
# TaggableManager()s on a model and thus you have to make a WHOLE other model
# to have this work.
# https://neutron-drive.appspot.com/blog/multiple-tags
class StupidFacilityLabelHack(TagBase):
pass
class StupidLabelHack(GenericTaggedItemBase):
tag = models.ForeignKey(
StupidFacilityLabelHack,
on_delete=models.CASCADE,
related_name="%(app_label)s_%(class)s_items",
)
class Facility(TimeStampedModel): class Facility(TimeStampedModel):
""" """
Represents a specific facility location. A Facility is some type of Represents a specific facility location. A Facility is some type of
...@@ -200,15 +183,6 @@ class Facility(TimeStampedModel): ...@@ -200,15 +183,6 @@ class Facility(TimeStampedModel):
help_text="A comma seperate list of words that neatly and aptly describe the product that this facility produces. These words are not shown to the use but are rather used in search.", help_text="A comma seperate list of words that neatly and aptly describe the product that this facility produces. These words are not shown to the use but are rather used in search.",
) )
# Labels to describe the Facility that are displayed to the user and can be
# informative. "Takes Mason Money"
facility_labels = TaggableManager(
"labels",
related_name="labels",
through=StupidLabelHack,
help_text="Labels to describe the Facility that are displayed to the user and can be informative.",
)
# Tag a Facility to be shown on the ShopMason or Sodoxo (or both) # Tag a Facility to be shown on the ShopMason or Sodoxo (or both)
# What's Open sites. # What's Open sites.
FACILITY_CLASSES = ( FACILITY_CLASSES = (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment