Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a field for project type.

  • Loading branch information...
commit 48b9f61adace514b88d4a352b618e95e9c746887 1 parent ae82b7e
@buchuki buchuki authored
View
43 ...ct/migrations/0007_auto__add_field_project_project_type__chg_field_project_description.py
@@ -0,0 +1,43 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Adding field 'Project.project_type'
+ db.add_column('project_project', 'project_type', self.gf('django.db.models.fields.CharField')(default='buildout', max_length=9), keep_default=False)
+
+ # Changing field 'Project.description'
+ db.alter_column('project_project', 'description', self.gf('django.db.models.fields.TextField')(blank=True))
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'Project.project_type'
+ db.delete_column('project_project', 'project_type')
+
+ # Changing field 'Project.description'
+ db.alter_column('project_project', 'description', self.gf('django.db.models.fields.TextField')())
+
+
+ models = {
+ 'project.project': {
+ 'Meta': {'object_name': 'Project'},
+ 'base_directory': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}),
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'favourite': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'git_repo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'project_type': ('django.db.models.fields.CharField', [], {'max_length': '9'}),
+ 'test_status': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['project']
View
3  greatbigcrane/project/models.py
@@ -21,6 +21,7 @@
from django.conf import settings
from buildout_manage.parser import buildout_parse
+make_choice = lambda x: ([(p,p) for p in x])
class Project(models.Model):
name = models.CharField(max_length=32)
@@ -28,6 +29,8 @@ class Project(models.Model):
git_repo = models.CharField(max_length=512, blank=True, default='')
description = models.TextField(blank=True,
help_text="(Markdown syntax is supported)")
+ project_type = models.CharField(max_length=9,
+ choices=make_choice(["buildout", "pip"]))
updated_at = models.DateTimeField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
test_status = models.BooleanField(default=False)
Please sign in to comment.
Something went wrong with that request. Please try again.