Add location to Event object

This commit is contained in:
Aarni Halinen
2019-03-12 15:10:52 +02:00
parent a708a6377d
commit 8194ab43cd
3 changed files with 20 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
# Generated by Django 2.1.5 on 2019-03-12 12:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0050_signupform_visible'),
]
operations = [
migrations.AddField(
model_name='event',
name='location',
field=models.CharField(blank=True, max_length=255),
),
]
+1
View File
@@ -63,6 +63,7 @@ class Event(BaseFeed):
end_time = models.DateTimeField(default=timezone.now)
signupForm = models.ManyToManyField(
'SignupForm', blank=True)
location = models.CharField(max_length=255, blank=True)
def __str__(self):
return _('Event: {}').format(self.title)
+1 -1
View File
@@ -25,7 +25,7 @@ class EventSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Event
fields = ('id', 'tag_id', 'tags', 'visible', 'title', 'description',
'content', 'start_time', 'end_time', 'signup_id', 'signupForm')
'content', 'start_time', 'end_time', 'location', 'signup_id', 'signupForm')
depth = 1
def create(self, validated_data):