Merge branch 'django1.6-compatibility' of https://github.com/mbrochh/symposion into mbrochh-django1.6-compatibility

Conflicts:
	symposion/boxes/urls.py
	symposion/cms/urls.py
	symposion/conference/urls.py
	symposion/proposals/models.py
	symposion/proposals/urls.py
	symposion/reviews/urls.py
	symposion/schedule/models.py
	symposion/schedule/urls.py
	symposion/speakers/urls.py
	symposion/sponsorship/urls.py
	symposion/teams/urls.py
This commit is contained in:
Patrick Altman 2014-12-15 15:15:46 -06:00
commit cb4b0fac38
12 changed files with 30 additions and 32 deletions

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import url, patterns
from django.conf.urls.defaults import url, patterns
urlpatterns = patterns("symposion.boxes.views", urlpatterns = patterns("symposion.boxes.views",

View file

@ -1,5 +1,5 @@
# flake8: noqa from django.conf.urls import url, patterns
from django.conf.urls.defaults import url, patterns
PAGE_RE = r"(([\w-]{1,})(/[\w-]{1,})*)/" PAGE_RE = r"(([\w-]{1,})(/[\w-]{1,})*)/"

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns("symposion.conference.views", urlpatterns = patterns("symposion.conference.views",

View file

@ -1,4 +1,3 @@
import datetime
import os import os
import uuid import uuid
@ -6,6 +5,7 @@ from django.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.db.models import Q from django.db.models import Q
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -37,20 +37,18 @@ class ProposalSection(models.Model):
@classmethod @classmethod
def available(cls): def available(cls):
now = datetime.datetime.now()
return cls._default_manager.filter( return cls._default_manager.filter(
Q(start__lt=now) | Q(start=None), Q(start__lt=now()) | Q(start=None),
Q(end__gt=now) | Q(end=None), Q(end__gt=now()) | Q(end=None),
Q(closed=False) | Q(closed=None), Q(closed=False) | Q(closed=None),
) )
def is_available(self): def is_available(self):
if self.closed: if self.closed:
return False return False
now = datetime.datetime.now() if self.start and self.start > now():
if self.start and self.start > now:
return False return False
if self.end and self.end < now: if self.end and self.end < now():
return False return False
return True return True
@ -102,7 +100,7 @@ class ProposalBase(models.Model):
"target='_blank'>Markdown</a>.") "target='_blank'>Markdown</a>.")
) )
submitted = models.DateTimeField( submitted = models.DateTimeField(
default=datetime.datetime.now, default=now,
editable=False, editable=False,
) )
speaker = models.ForeignKey("speakers.Speaker", related_name="proposals") speaker = models.ForeignKey("speakers.Speaker", related_name="proposals")
@ -175,7 +173,8 @@ class SupportingDocument(models.Model):
proposal = models.ForeignKey(ProposalBase, related_name="supporting_documents") proposal = models.ForeignKey(ProposalBase, related_name="supporting_documents")
uploaded_by = models.ForeignKey(User) uploaded_by = models.ForeignKey(User)
created_at = models.DateTimeField(default=datetime.datetime.now)
created_at = models.DateTimeField(default=now)
file = models.FileField(upload_to=uuid_filename) file = models.FileField(upload_to=uuid_filename)
description = models.CharField(max_length=140) description = models.CharField(max_length=140)

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import *
urlpatterns = patterns("symposion.proposals.views", urlpatterns = patterns("symposion.proposals.views",

View file

@ -7,7 +7,12 @@ from django.core.urlresolvers import reverse
from django.db.models import Q from django.db.models import Q
from django.http import Http404, HttpResponse, HttpResponseForbidden from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.utils.hashcompat import sha_constructor
try:
from hashlib import sha1 as sha_constructor
except ImportError:
from django.utils.hashcompat import sha_constructor
from django.views import static from django.views import static
from django.contrib import messages from django.contrib import messages

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns("symposion.reviews.views", urlpatterns = patterns("symposion.reviews.views",

View file

@ -80,8 +80,9 @@ class Slot(models.Model):
Unassign the associated content with this slot. Unassign the associated content with this slot.
""" """
if self.content and self.content.slot_id: if self.content and self.content.slot_id:
self.content.slot = None presentation = self.content
self.content.save() presentation.slot = None
presentation.save()
@property @property
def content(self): def content(self):

View file

@ -1,5 +1,5 @@
# flake8: noqa from django.conf.urls import url, patterns
from django.conf.urls.defaults import url, patterns
urlpatterns = patterns("symposion.schedule.views", urlpatterns = patterns("symposion.schedule.views",
url(r"^$", "schedule_conference", name="schedule_conference"), url(r"^$", "schedule_conference", name="schedule_conference"),

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import *
urlpatterns = patterns("symposion.speakers.views", urlpatterns = patterns("symposion.speakers.views",

View file

@ -1,10 +1,9 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView
from django.views.generic.simple import direct_to_template
urlpatterns = patterns("symposion.sponsorship.views", urlpatterns = patterns("symposion.sponsorship.views",
url(r"^$", direct_to_template, {"template": "sponsorship/list.html"}, name="sponsor_list"), url(r"^$", TemplateView.as_view(template_name="sponsorship/list.html"), name="sponsor_list"),
url(r"^apply/$", "sponsor_apply", name="sponsor_apply"), url(r"^apply/$", "sponsor_apply", name="sponsor_apply"),
url(r"^add/$", "sponsor_add", name="sponsor_add"), url(r"^add/$", "sponsor_add", name="sponsor_add"),
url(r"^(?P<pk>\d+)/$", "sponsor_detail", name="sponsor_detail"), url(r"^(?P<pk>\d+)/$", "sponsor_detail", name="sponsor_detail"),

View file

@ -1,5 +1,4 @@
# flake8: noqa from django.conf.urls import patterns, url
from django.conf.urls.defaults import *
urlpatterns = patterns("symposion.teams.views", urlpatterns = patterns("symposion.teams.views",