Resolve merge conflict.

This commit is contained in:
Víðir Valberg Guðmundsson 2016-07-13 21:44:09 +02:00
parent 4381dbd2bd
commit 5c00934027
6 changed files with 42 additions and 14 deletions

View File

@ -30,6 +30,7 @@ INSTALLED_APPS = [
'news', 'news',
'utils', 'utils',
'villages', 'villages',
'program',
'allauth', 'allauth',
'allauth.account', 'allauth.account',

View File

@ -73,6 +73,12 @@ class Day(CreatedUpdatedModel, UUIDModel):
help_text=_('What date?') help_text=_('What date?')
) )
def __str__(self):
return '{} {}'.format(
self.date,
self.camp
)
class Expense(CreatedUpdatedModel, UUIDModel): class Expense(CreatedUpdatedModel, UUIDModel):
class Meta: class Meta:

View File

@ -1,6 +1,20 @@
from django.contrib import admin from django.contrib import admin
from .models import Event, Speaker from .models import Event, Speaker, EventType
@admin.register(EventType)
class EventTypeAdmin(admin.ModelAdmin):
pass
@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
pass
@admin.register(Speaker)
class SpeakerAdmin(admin.ModelAdmin):
pass
admin.site.register(Event)
admin.site.register(Speaker)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-03 17:17 # Generated by Django 1.9.6 on 2016-07-13 19:38
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
@ -11,6 +11,7 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('camps', '0005_auto_20160510_2011'),
] ]
operations = [ operations = [
@ -22,6 +23,9 @@ class Migration(migrations.Migration):
('updated', models.DateTimeField(auto_now=True)), ('updated', models.DateTimeField(auto_now=True)),
('title', models.CharField(max_length=255)), ('title', models.CharField(max_length=255)),
('description', models.TextField()), ('description', models.TextField()),
('start', models.TimeField()),
('end', models.TimeField()),
('days', models.ManyToManyField(to='camps.Day')),
], ],
options={ options={
'abstract': False, 'abstract': False,
@ -48,7 +52,7 @@ class Migration(migrations.Migration):
('updated', models.DateTimeField(auto_now=True)), ('updated', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=150)), ('name', models.CharField(max_length=150)),
('biography', models.TextField()), ('biography', models.TextField()),
('picture', models.ImageField(upload_to=b'')), ('picture', models.ImageField(blank=True, null=True, upload_to=b'')),
('events', models.ManyToManyField(related_name='speakers', related_query_name='speaker', to='program.Event')), ('events', models.ManyToManyField(related_name='speakers', related_query_name='speaker', to='program.Event')),
], ],
options={ options={

View File

@ -1,29 +1,33 @@
"""Model definitions for the program app."""
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models from django.db import models
from django.contrib.postgres.fields import DateTimeRangeField
from utils.models import CreatedUpdatedModel from utils.models import CreatedUpdatedModel
class EventType(CreatedUpdatedModel): class EventType(CreatedUpdatedModel):
'''Every event needs to have a type.''' """ Every event needs to have a type. """
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
slug = models.SlugField() slug = models.SlugField()
class Event(CreatedUpdatedModel): class Event(CreatedUpdatedModel):
'''Something that is on the program.''' """ Something that is on the program. """
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
description = models.TextField() description = models.TextField()
event_type = models.ForeignKey( event_type = models.ForeignKey(EventType)
EventType) days = models.ManyToManyField('camps.Day')
start = models.TimeField()
end = models.TimeField()
class Speaker(CreatedUpdatedModel): class Speaker(CreatedUpdatedModel):
'''Person anchoring an event.''' """ Person anchoring an event. """
name = models.CharField(max_length=150) name = models.CharField(max_length=150)
biography = models.TextField() biography = models.TextField()
picture = models.ImageField() picture = models.ImageField(null=True, blank=True)
events = models.ManyToManyField( events = models.ManyToManyField(
Event, Event,
related_name='speakers', related_name='speakers',
related_query_name='speaker') related_query_name='speaker'
)

View File

@ -1,3 +1,2 @@
from django.shortcuts import render from django.shortcuts import render
# Create your views here.