Commit 0848250a by Matthew Piatetsky

Convert organizations tags to typeahead and add tags to Course Runs

ECOM-7021
parent 17f4da7e
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-01-31 17:49
from __future__ import unicode_literals
from django.db import migrations
import taggit_autosuggest.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),
('course_metadata', '0043_courserun_course_overridden'),
]
operations = [
migrations.AddField(
model_name='courserun',
name='tags',
field=taggit_autosuggest.managers.TaggableManager(blank=True, help_text='Pick a tag from the suggestions. To make a new tag, add a comma after the tag name.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
),
migrations.AlterField(
model_name='organization',
name='tags',
field=taggit_autosuggest.managers.TaggableManager(blank=True, help_text='Pick a tag from the suggestions. To make a new tag, add a comma after the tag name.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
),
]
...@@ -18,7 +18,7 @@ from haystack.query import SearchQuerySet ...@@ -18,7 +18,7 @@ from haystack.query import SearchQuerySet
from sortedm2m.fields import SortedManyToManyField from sortedm2m.fields import SortedManyToManyField
from stdimage.models import StdImageField from stdimage.models import StdImageField
from stdimage.utils import UploadToAutoSlug from stdimage.utils import UploadToAutoSlug
from taggit.managers import TaggableManager from taggit_autosuggest.managers import TaggableManager
from course_discovery.apps.core.models import Currency, Partner from course_discovery.apps.core.models import Currency, Partner
from course_discovery.apps.course_metadata.choices import CourseRunStatus, CourseRunPacing, ProgramStatus from course_discovery.apps.course_metadata.choices import CourseRunStatus, CourseRunPacing, ProgramStatus
...@@ -167,7 +167,10 @@ class Organization(TimeStampedModel): ...@@ -167,7 +167,10 @@ class Organization(TimeStampedModel):
'logo_image_url, copy and paste the same value to both fields.') 'logo_image_url, copy and paste the same value to both fields.')
) )
tags = TaggableManager(blank=True) tags = TaggableManager(
blank=True,
help_text=_('Pick a tag from the suggestions. To make a new tag, add a comma after the tag name.'),
)
class Meta: class Meta:
unique_together = ( unique_together = (
...@@ -379,6 +382,11 @@ class CourseRun(TimeStampedModel): ...@@ -379,6 +382,11 @@ class CourseRun(TimeStampedModel):
help_text=_('Indicates whether the course relation has been manually overridden.') help_text=_('Indicates whether the course relation has been manually overridden.')
) )
tags = TaggableManager(
blank=True,
help_text=_('Pick a tag from the suggestions. To make a new tag, add a comma after the tag name.'),
)
objects = CourseRunQuerySet.as_manager() objects = CourseRunQuerySet.as_manager()
def _enrollable_paid_seats(self): def _enrollable_paid_seats(self):
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 16:30+0500\n" "POT-Creation-Date: 2017-01-31 13:03-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -274,6 +274,12 @@ msgid "" ...@@ -274,6 +274,12 @@ msgid ""
msgstr "" msgstr ""
#: apps/course_metadata/models.py #: apps/course_metadata/models.py
msgid ""
"Pick a tag from the suggestions. To make a new tag, add a comma after the "
"tag name."
msgstr ""
#: apps/course_metadata/models.py
msgid "People" msgid "People"
msgstr "" msgstr ""
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 16:30+0500\n" "POT-Creation-Date: 2017-01-31 13:03-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 16:30+0500\n" "POT-Creation-Date: 2017-01-31 13:03-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -329,6 +329,14 @@ msgstr "" ...@@ -329,6 +329,14 @@ msgstr ""
"lögö_ïmägé_ürl, çöpý änd pästé thé sämé välüé tö ßöth fïélds. Ⱡ'σяє#" "lögö_ïmägé_ürl, çöpý änd pästé thé sämé välüé tö ßöth fïélds. Ⱡ'σяє#"
#: apps/course_metadata/models.py #: apps/course_metadata/models.py
msgid ""
"Pick a tag from the suggestions. To make a new tag, add a comma after the "
"tag name."
msgstr ""
"Pïçk ä täg fröm thé süggéstïöns. Tö mäké ä néw täg, ädd ä çömmä äftér thé "
"täg nämé. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢т#"
#: apps/course_metadata/models.py
msgid "People" msgid "People"
msgstr "Péöplé Ⱡ'σяєм ιρѕυ#" msgstr "Péöplé Ⱡ'σяєм ιρѕυ#"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 16:30+0500\n" "POT-Creation-Date: 2017-01-31 13:03-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
...@@ -49,6 +49,7 @@ THIRD_PARTY_APPS = [ ...@@ -49,6 +49,7 @@ THIRD_PARTY_APPS = [
'storages', 'storages',
'django_comments', 'django_comments',
'taggit', 'taggit',
'taggit_autosuggest',
'taggit_serializer', 'taggit_serializer',
'solo', 'solo',
] ]
......
...@@ -47,6 +47,7 @@ urlpatterns = auth_urlpatterns + [ ...@@ -47,6 +47,7 @@ urlpatterns = auth_urlpatterns + [
url(r'^comments/', include('django_comments.urls')), url(r'^comments/', include('django_comments.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', name='javascript-catalog'), url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', name='javascript-catalog'),
url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
] ]
if settings.DEBUG: # pragma: no cover if settings.DEBUG: # pragma: no cover
......
...@@ -17,7 +17,8 @@ django-solo==1.1.2 ...@@ -17,7 +17,8 @@ django-solo==1.1.2
django-sortedm2m==1.3.2 django-sortedm2m==1.3.2
django-stdimage==2.3.3 django-stdimage==2.3.3
django-storages==1.5.0 django-storages==1.5.0
django-taggit==0.20.2 django-taggit==0.22.0
django-taggit-autosuggest==0.3.0
django-taggit-serializer==0.1.5 django-taggit-serializer==0.1.5
django-waffle==0.11.1 django-waffle==0.11.1
djangorestframework==3.3.3 djangorestframework==3.3.3
......
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