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',
'utils',
'villages',
'program',
'allauth',
'allauth.account',

View file

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

View file

@ -1,6 +1,20 @@
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 -*-
# 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 django.db import migrations, models
@ -11,6 +11,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('camps', '0005_auto_20160510_2011'),
]
operations = [
@ -22,6 +23,9 @@ class Migration(migrations.Migration):
('updated', models.DateTimeField(auto_now=True)),
('title', models.CharField(max_length=255)),
('description', models.TextField()),
('start', models.TimeField()),
('end', models.TimeField()),
('days', models.ManyToManyField(to='camps.Day')),
],
options={
'abstract': False,
@ -48,7 +52,7 @@ class Migration(migrations.Migration):
('updated', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=150)),
('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')),
],
options={

View file

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

View file

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