diff --git a/events/migrations/0009_auto_20180225_2202.py b/events/migrations/0009_auto_20180225_2202.py new file mode 100644 index 0000000..76526d2 --- /dev/null +++ b/events/migrations/0009_auto_20180225_2202.py @@ -0,0 +1,62 @@ +# Generated by Django 2.0 on 2018-02-25 22:02 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0008_add-team-description'), + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('description', models.TextField()), + ('img', models.URLField()), + ], + ), + migrations.CreateModel( + name='Topic', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('description', models.TextField()), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Category')), + ], + ), + migrations.AlterField( + model_name='event', + name='tags', + field=models.CharField(blank=True, help_text='Comma-separates list of tags', max_length=128, null=True, verbose_name='Keyword Tags'), + ), + migrations.AlterField( + model_name='searchable', + name='venue_name', + field=models.CharField(blank=True, max_length=256), + ), + migrations.AlterField( + model_name='userprofile', + name='avatar', + field=models.URLField(blank=True, max_length=150, null=True, verbose_name='Photo Image'), + ), + migrations.AddField( + model_name='event', + name='topics', + field=models.ManyToManyField(blank=True, to='events.Topic'), + ), + migrations.AddField( + model_name='team', + name='categories', + field=models.ManyToManyField(blank=True, to='events.Category'), + ), + migrations.AddField( + model_name='team', + name='topics', + field=models.ManyToManyField(blank=True, to='events.Topic'), + ), + ] diff --git a/events/models/events.py b/events/models/events.py index 2f76ba6..bccd3fd 100644 --- a/events/models/events.py +++ b/events/models/events.py @@ -64,12 +64,14 @@ class Event(models.Model): created_by = models.ForeignKey(UserProfile, on_delete=models.CASCADE) created_time = models.DateTimeField(help_text=_('the date and time when the event was created'), default=datetime.datetime.now, db_index=True) - tags = models.CharField(verbose_name=_("Keyword Tags"), blank=True, null=True, max_length=128) + tags = models.CharField(verbose_name=_("Keyword Tags"), help_text=_('Comma-separates list of tags'), blank=True, null=True, max_length=128) #image #replies attendees = models.ManyToManyField(UserProfile, through='Attendee', related_name="attending", blank=True) + topics = models.ManyToManyField('Topic', blank=True) + def get_absolute_url(self): return reverse('show-event', kwargs={'event_id': self.id, 'event_slug': self.slug}) diff --git a/events/models/profiles.py b/events/models/profiles.py index 0a4ace9..a69ed10 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -157,6 +157,9 @@ class Team(models.Model): members = models.ManyToManyField(UserProfile, through='Member', related_name="memberships", blank=True) + categories = models.ManyToManyField('Category', blank=True) + topics = models.ManyToManyField('Topic', blank=True) + @property def location_name(self): if self.city: