Skip to content

Commit

Permalink
adding south migrations, enabling excerpt field in the model and admin
Browse files Browse the repository at this point in the history
  • Loading branch information
mhowsden committed Mar 8, 2011
1 parent 623ada3 commit 5e24819
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion staticpages/admin.py
Expand Up @@ -18,7 +18,7 @@ class Meta:
class FatPageAdmin(admin.ModelAdmin):
form = FatpageForm
fieldsets = (
(None, {'fields': ('url', 'title', 'content', 'enable_comments', 'template_name')}),
(None, {'fields': ('url', 'title', 'content', 'enable_comments', 'excerpt', 'template_name')}),
)
list_display = ('title', 'url')
search_fields = ('title', 'url')
Expand Down
43 changes: 43 additions & 0 deletions staticpages/migrations/0001_initial.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 model 'FatPage'
db.create_table('django_flatpage', (
('registration_required', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=200)),
('url', self.gf('django.db.models.fields.CharField')(max_length=100, db_index=True)),
('template_name', self.gf('django.db.models.fields.CharField')(max_length=70, blank=True)),
('content', self.gf('ckeditor.fields.RichTextField')(null=True, blank=True)),
('enable_comments', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
))
db.send_create_signal('staticpages', ['FatPage'])


def backwards(self, orm):

# Deleting model 'FatPage'
db.delete_table('django_flatpage')


models = {
'staticpages.fatpage': {
'Meta': {'object_name': 'FatPage', 'db_table': "'django_flatpage'"},
'content': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'enable_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'registration_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'template_name': ('django.db.models.fields.CharField', [], {'max_length': '70', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'})
}
}

complete_apps = ['staticpages']
Binary file added staticpages/migrations/0001_initial.pyc
Binary file not shown.
35 changes: 35 additions & 0 deletions staticpages/migrations/0002_open_wire_callout_excerpt.py
@@ -0,0 +1,35 @@
# 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 'FatPage.excerpt'
db.add_column('django_flatpage', 'excerpt', self.gf('ckeditor.fields.RichTextField')(null=True, blank=True), keep_default=False)


def backwards(self, orm):

# Deleting field 'FatPage.excerpt'
db.delete_column('django_flatpage', 'excerpt')


models = {
'staticpages.fatpage': {
'Meta': {'object_name': 'FatPage', 'db_table': "'django_flatpage'"},
'content': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'enable_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'excerpt': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'registration_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'template_name': ('django.db.models.fields.CharField', [], {'max_length': '70', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'})
}
}

complete_apps = ['staticpages']
Binary file not shown.
Empty file.
Binary file added staticpages/migrations/__init__.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions staticpages/models.py
Expand Up @@ -7,6 +7,7 @@ class FatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = RichTextField(null=True, blank=True)
excerpt = RichTextField(null=True, blank=True)
enable_comments = models.BooleanField(_('enable comments'))
template_name = models.CharField(_('template name'), max_length=70, blank=True,
help_text=_("Example: 'staticpages/contact_page.html'. If this isn't provided, the system will use 'the default."))
Expand Down

0 comments on commit 5e24819

Please sign in to comment.