Permalink
Browse files

Merge pull request #73 from rossbruniges/andrew-bugs

Work on #66 - an initial migration for the challenge
  • Loading branch information...
2 parents 7e5355f + 8d34e19 commit b177b38e1e421a3bec454c1923d70104a83a22e7 @rossbruniges rossbruniges committed Dec 4, 2012
View
2 gameon/base/templates/404.html
@@ -12,7 +12,7 @@ <h1 class="busta shout">Oops - looks like you've found a broken link</h1>
<div class="busta">
<div class="cf">
<div class="main-col">
- <h2 class="exclaim"></h2>
+ <p>Nothing to worry about, probably one of the things below:</p>
<ul class="whimper">
<li>Check your spelling and check again.</li>
<li>if you clicked a link from somewhere else check that they're aren't any special hidden characters, if you find out that they've posted the wrong link then it would be awesome if you could let them know.</li>
View
3 gameon/settings/base.py
@@ -8,6 +8,9 @@
# clone.
PROJECT_MODULE = 'gameon'
+# This is used by get_current_challenge in gameon/submissions/managers.py
+# It gets added into the DB as part of gameon/submissions/migrations/0009_initial_challenge.py
+# If the DB value changes, or you add in a new current challenge also change this
GAMEON_CHALLENGE_SLUG = 'gameon-2013'
MARKETPLACE_URL = 'https://marketplace.firefox.com/developers/docs/mkt_submission'
View
2 gameon/static_site/templates/static_site/landing.html
@@ -21,7 +21,7 @@
{% if not request.challenge.has_started() %}
<p>Submissions open on {{ request.challenge.start_date.strftime('%B %e, %Y') }}</p>
{% endif %}
- {% if not request.challenge.has_closed() %}
+ {% if request.challenge.has_closed() %}
<p><a href="{{ url('submissions.entry_list') }}">See what people submitted</a></p>
{% endif %}
{% endif %}
View
110 gameon/submissions/migrations/0009_initial_challenge.py
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+from south.v2 import DataMigration
+from django.core.exceptions import ObjectDoesNotExist
+from django.conf import settings
+
+GAMEON_CHALLENGE_SLUG = settings.GAMEON_CHALLENGE_SLUG
+
+
+class Migration(DataMigration):
+
+ depends_on = (
+ ('submissions', '0008_fix_desciption_typo'),
+ )
+
+ def forwards(self, orm):
+ try:
+ category = (orm['submissions.Challenge'].objects
+ .get(slug=GAMEON_CHALLENGE_SLUG))
+ except ObjectDoesNotExist:
+ category_data = {
+ 'name': 'Gameon 2013',
+ 'slug': GAMEON_CHALLENGE_SLUG,
+ 'start_date': '2012-12-11 00:00:00',
+ 'end_date': '2013-02-20 23:59:59',
+ }
+ category = orm['submissions.Challenge'].objects.create(**category_data)
+
+ def backwards(self, orm):
+ "Write your backwards methods here."
+ print "Not removing any data from the DB, we can't know for certain what was there before"
+ pass
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'submissions.category': {
+ 'Meta': {'object_name': 'Category'},
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
+ },
+ 'submissions.challenge': {
+ 'Meta': {'object_name': 'Challenge'},
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '200'}),
+ 'start_date': ('django.db.models.fields.DateTimeField', [], {})
+ },
+ 'submissions.entry': {
+ 'Meta': {'object_name': 'Entry'},
+ 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['submissions.Category']", 'null': 'True', 'blank': 'True'}),
+ 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']", 'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'default': "''"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
+ 'team_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'team_members': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'team_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'to_market': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}),
+ 'video_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '255'})
+ },
+ 'users.profile': {
+ 'Meta': {'object_name': 'Profile'},
+ 'bio': ('django.db.models.fields.TextField', [], {'default': "''"}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
+ 'website': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '255'})
+ }
+ }
+
+ complete_apps = ['submissions']

0 comments on commit b177b38

Please sign in to comment.