Skip to content

Commit

Permalink
Added name field to Chunk model
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
leandro-gomez committed Mar 25, 2013
1 parent 88b9579 commit b72806b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
42 changes: 42 additions & 0 deletions cms_chunks/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: 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 model 'Chunk'
db.create_table('cms_chunks_chunk', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('tags', self.gf('django.db.models.fields.CharField')(max_length=200)),
('code', self.gf('django.db.models.fields.related.ForeignKey')(related_name='chunks', null=True, to=orm['cms.Placeholder'])),
('priority', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal('cms_chunks', ['Chunk'])


def backwards(self, orm):
# Deleting model 'Chunk'
db.delete_table('cms_chunks_chunk')


models = {
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'cms_chunks.chunk': {
'Meta': {'object_name': 'Chunk'},
'code': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'chunks'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '200'})
}
}

complete_apps = ['cms_chunks']
39 changes: 39 additions & 0 deletions cms_chunks/migrations/0002_auto__add_field_chunk_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: 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 'Chunk.name'
db.add_column('cms_chunks_chunk', 'name',
self.gf('django.db.models.fields.CharField')(default='', max_length=200),
keep_default=False)


def backwards(self, orm):
# Deleting field 'Chunk.name'
db.delete_column('cms_chunks_chunk', 'name')


models = {
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'cms_chunks.chunk': {
'Meta': {'object_name': 'Chunk'},
'code': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'chunks'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '200'})
}
}

complete_apps = ['cms_chunks']
Empty file.
1 change: 1 addition & 0 deletions cms_chunks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


class Chunk(models.Model):
name = models.CharField(max_length=200)
tags = models.CharField(max_length=200)
code = PlaceholderField('chunk_placeholder', related_name="chunks")
priority = models.IntegerField()
Expand Down
1 change: 1 addition & 0 deletions test_app/cms_chunks

0 comments on commit b72806b

Please sign in to comment.