Skip to content

Commit 9740dfd

Browse files
committed
Updates for upgrading to Django 1.6
1 parent 9c342e6 commit 9740dfd

File tree

13 files changed

+52
-24
lines changed

13 files changed

+52
-24
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013 David A. Krauth
1+
Copyright (c) 2014 David A. Krauth
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Features
6464
Requirements
6565
------------
6666

67-
* Django 1.4
67+
* Django 1.6
6868
* Python 2.7
6969
* [dateutil](http://labix.org/python-dateutil)
7070

demo/demo_site/media/css/demo.css

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ h1 { font-size: 2.33em; text-align: center; }
33
h2 { font-size: 2em; color: #543; margin: 1em 0 .5em; text-align: center;}
44
h3 { font-size: 1.66em; color: #655; font-size: 1.33em; margin: 1em 0 .5em; }
55
h4 { font-size: 1.33em; color: #877; font-size: 1.33em; margin: 1em 0 .5em; }
6-
a { text-decoration: none; color: #357; }
7-
a:hover { text-decoration: underline; }
6+
p { margin-bottom: 1em; }
7+
a { color: #357; }
88
table {border-collapse: collapse; border-spacing: 0;}
99
caption, th, td {text-align: left; }
1010
th, td { padding: 4px; border: 1px solid #eee; }
@@ -24,7 +24,9 @@ img { border: none; }
2424
background: #fff url(/media/img/karatedo.png) no-repeat left 10px;
2525
}
2626
header h1 { border: 1px solid #999; border-radius: 4px; background-color: #bba; }
27+
header h1 a { text-decoration: none; }
2728
nav { text-align: center; font-weight: bold; }
29+
nav a { text-decoration: none; }
2830
dt { font-weight: bold; }
2931
dd { margin-bottom: .5em; }
3032
form table { width: 100%; border: 1px solid #aaa; }
@@ -34,6 +36,34 @@ form table { width: 100%; border: 1px solid #aaa; }
3436
form table th { text-align: right; width: 10em; }
3537
form tfoot td { text-align: center; background-color: #566; }
3638
form input[type="text"] { padding: 2px 4px; border-radius: 2px; border: 1px solid #ccc; }
39+
a.plain { text-decoration: none; }
40+
41+
.btn {
42+
display: inline-block;
43+
padding: 2px 8px;
44+
text-decoration: none;
45+
border: 1px solid #ccc;
46+
border-radius: 4px;
47+
background: #a9db80;
48+
background: -moz-linear-gradient(top, #a9db80 0%, #96c56f 100%);
49+
background: -webkit-linear-gradient(top, #a9db80 0%,#96c56f 100%);
50+
background: -ms-linear-gradient(top, #a9db80 0%,#96c56f 100%);
51+
background: linear-gradient(to bottom, #a9db80 0%,#96c56f 100%);
52+
}
53+
.btn:hover {
54+
background: #96c56f;
55+
background: -moz-linear-gradient(top, #96c56f 0%, #a9db80 100%);
56+
background: -webkit-linear-gradient(top, #96c56f 0%,#a9db80 100%);
57+
background: -ms-linear-gradient(top, #96c56f 0%,#a9db80 100%);
58+
background: linear-gradient(to bottom, #96c56f 0%,#a9db80 100%);
59+
}
60+
nav a.btn {
61+
display: block;
62+
width: 14em;
63+
margin: 1em auto;
64+
padding: 4px;
65+
text-align: center;
66+
}
3767
.form-indent { margin-left: 2.5em; }
3868
.horizontal { width: 30em; }
3969
.horizontal li { float: left; margin: 0; }

demo/demo_site/settings.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
'django.core.context_processors.debug',
3838
'django.core.context_processors.media',
3939
'django.contrib.auth.context_processors.auth',
40-
'django.contrib.messages.context_processors.messages',
4140
'swingtime.context_processors.current_datetime',
4241
)
4342

@@ -50,11 +49,7 @@
5049
'django.contrib.auth',
5150
'django.contrib.contenttypes',
5251
'django.contrib.sessions',
53-
'django.contrib.messages',
54-
#'django.contrib.sites',
5552
'django.contrib.admin',
56-
'django.contrib.staticfiles',
57-
5853
'swingtime',
5954
'karate',
6055
)

demo/demo_site/templates/intro.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ <h2>Introduction</h2>
2424
Quick start: View today's calendar and <a href="{% url 'swingtime-today' %}">
2525
add a new event by clicking a time slot &raquo;</a>
2626
</p>
27-
28-
<hr>
29-
<h3 class="center"><a href="{% url 'karate-home' %}">Continue Demo &raquo;</a></h3>
30-
<h3 class="center"><a href="/docs/index.html">Swingtime Documentation &raquo;</a></h3>
31-
<h3 class="center"><a href="https://github.com/dakrauth/django-swingtime">Swingtime Source Code &raquo;</a></h3>
27+
28+
<nav>
29+
<a class="btn" href="{% url 'karate-home' %}">Continue Demo &raquo;</a>
30+
<a class="btn" href="/docs/index.html">Swingtime Documentation &raquo;</a>
31+
<a class="btn" href="https://github.com/dakrauth/django-swingtime">Swingtime Source Code &raquo;</a>
32+
</nav>
3233
{% endblock main_content %}

demo/demo_site/templates/swingtime/daily_view.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
{% block main_content %}
55
<h3>Daily View</h3>
66
<h4>
7-
<a href="{% url 'swingtime-daily-view' prev_day.year prev_day.month prev_day.day %}">&larr;</a>
7+
<a class="plain" href="{% url 'swingtime-daily-view' prev_day.year prev_day.month prev_day.day %}">&larr;</a>
88
{{ day|date:"l, N jS Y" }}
9-
<a href="{% url 'swingtime-daily-view' next_day.year next_day.month next_day.day %}">&rarr;</a>
9+
<a class="plain" href="{% url 'swingtime-daily-view' next_day.year next_day.month next_day.day %}">&rarr;</a>
1010
</h4>
1111
<table class="calendar">
1212
<thead>

demo/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python-dateutil==2.2
2-
Django<1.6
1+
python-dateutil
2+
Django<1.7

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# General information about the project.
4141
project = u'Swingtime'
42-
copyright = u'2013, David Krauth'
42+
copyright = u'2014, David Krauth'
4343

4444
# The version info for the project you're documenting, acts as replacement for
4545
# |version| and |release|, also used in various other places throughout the
@@ -48,7 +48,7 @@
4848
# The short X.Y version.
4949
version = '0.3'
5050
# The full version, including alpha/beta/rc tags.
51-
release = '0.3.0'
51+
release = '0.3.2'
5252

5353
# The language for content autogenerated by Sphinx. Refer to documentation
5454
# for a list of supported languages.

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ following (please note that for the following commands you have already installe
5252
$ cd django-swingtime-master/demo
5353
$ mkvirtualenv swingtime_demo
5454
$ pip install -r requirements.txt
55-
$ pip install django-extensions Sphinx # <-- optional
55+
$ pip install pytz django-extensions Sphinx # <-- optional
5656

5757

5858
And, finally::

docs/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Features
7474
Requirements
7575
------------
7676

77-
* `Django 1.4+ <http://www.djangoproject.com/download/>`_
77+
* `Django 1.6 <http://www.djangoproject.com/download/>`_
7878
* Python 2.7
7979
* The ``dateutil`` `package <http://labix.org/python-dateutil>`_.
8080

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
],
2020
install_requires=[
2121
'python-dateutil',
22-
'django',
22+
'django>=1.6',
2323
]
2424
)

swingtime/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (0, 3, 1, 'beta', 0)
1+
VERSION = (0, 3, 2, 'beta', 0)
22

33
#-------------------------------------------------------------------------------
44
def get_version():

swingtime/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ class EventForm(forms.ModelForm):
388388
#===========================================================================
389389
class Meta:
390390
model = Event
391+
fields = "__all__"
391392

392393
#---------------------------------------------------------------------------
393394
def __init__(self, *args, **kws):
@@ -408,5 +409,6 @@ class SingleOccurrenceForm(forms.ModelForm):
408409
#===========================================================================
409410
class Meta:
410411
model = Occurrence
412+
fields = "__all__"
411413

412414

0 commit comments

Comments
 (0)