Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conference app draft #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Django==1.8.7
django-compressor==1.6
Pillow==3.0.0
Empty file added summit/conference/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions summit/conference/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib import admin
from . import models

admin.site.register(models.Talk)
admin.site.register(models.SponsorshipOption)
admin.site.register(models.Sponsor)
53 changes: 53 additions & 0 deletions summit/conference/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Sponsor',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('contact', models.EmailField(null=True, max_length=254, blank=True)),
('link', models.URLField(null=True, blank=True)),
('image', models.ImageField(upload_to='')),
('description', models.TextField(blank=True)),
],
),
migrations.CreateModel(
name='SponsorshipOption',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('name', models.CharField(max_length=60)),
('on_site', models.BooleanField(default=True)),
('order', models.IntegerField()),
],
),
migrations.CreateModel(
name='Talk',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('status', models.CharField(max_length=15, choices=[('PROP', 'proposed'), ('ACC', 'accepted'), ('CAN', 'cancelled')])),
('title', models.CharField(max_length=250)),
('description', models.TextField()),
('date', models.DateTimeField(null=True, blank=True)),
('slides_link', models.URLField(null=True, blank=True)),
('video_link', models.URLField(null=True, blank=True)),
('featured', models.BooleanField(default=None)),
('presenter', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='sponsor',
name='options',
field=models.ManyToManyField(to='conference.SponsorshipOption'),
),
]
Empty file.
43 changes: 43 additions & 0 deletions summit/conference/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from django.conf import settings
from django.db import models

# TODO: do we need a Conference model and all those models should be related to the specific Conference?


class Talk(models.Model):

class Status:
proposed = 'PROP'
accepted = 'ACC'
cancelled = 'CAN'

STATUSES = (
(Status.proposed, 'proposed'),
(Status.accepted, 'accepted'),
(Status.cancelled, 'cancelled'),
)

status = models.CharField(max_length=15, choices=STATUSES)
presenter = models.ForeignKey(settings.AUTH_USER_MODEL)

title = models.CharField(max_length=250)
description = models.TextField()
date = models.DateTimeField(blank=True, null=True) # only accepted talks appearing in agenda need to have it
slides_link = models.URLField(blank=True, null=True)
video_link = models.URLField(blank=True, null=True)
featured = models.BooleanField(default=None)


class SponsorshipOption(models.Model):
name = models.CharField(max_length=60)
on_site = models.BooleanField(default=True) # for special kinds of sponsorhip - after party, etc.
order = models.IntegerField() # order of appearance on site


class Sponsor(models.Model):
options = models.ManyToManyField(SponsorshipOption)

contact = models.EmailField(blank=True, null=True)
link = models.URLField(blank=True, null=True)
image = models.ImageField()
description = models.TextField(blank=True)
3 changes: 3 additions & 0 deletions summit/conference/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions summit/conference/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
1 change: 1 addition & 0 deletions summit/summit/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_env_var(name, **kwargs):
'django.contrib.messages',
'django.contrib.staticfiles',
'compressor',
'conference',
)

MIDDLEWARE_CLASSES = (
Expand Down