Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To django 1 11 #3

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
File renamed without changes.
2 changes: 1 addition & 1 deletion django_quickblocks/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib import admin
from models import QuickBlock, QuickBlockType
from .models import QuickBlock, QuickBlockType

class QuickBlockTypeAdmin(admin.ModelAdmin):
list_display = ('slug', 'created_on', 'created_by')
Expand Down
199 changes: 87 additions & 112 deletions django_quickblocks/migrations/0001_initial.py

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions django_quickblocks/migrations/0002_auto_20180809_2039.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-08-09 18:39
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('django_quickblocks', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='quickblock',
name='created_by',
field=models.ForeignKey(help_text='The user which originally created this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblock_creations', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='quickblock',
name='modified_by',
field=models.ForeignKey(help_text='The user which last modified this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblock_modifications', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='quickblockimage',
name='created_by',
field=models.ForeignKey(help_text='The user which originally created this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblockimage_creations', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='quickblockimage',
name='modified_by',
field=models.ForeignKey(help_text='The user which last modified this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblockimage_modifications', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='quickblocktype',
name='created_by',
field=models.ForeignKey(help_text='The user which originally created this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblocktype_creations', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='quickblocktype',
name='modified_by',
field=models.ForeignKey(help_text='The user which last modified this item', on_delete=django.db.models.deletion.PROTECT, related_name='django_quickblocks_quickblocktype_modifications', to=settings.AUTH_USER_MODEL),
),
]
14 changes: 12 additions & 2 deletions django_quickblocks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ class QuickBlockType(SmartModel):
def __unicode__(self):
return self.name

def __str__(self):
return self.name

class QuickBlock(SmartModel):
"""
A QuickBlock is just a block of content, organized by type and priority. All fields are optional
letting you use them for different things.
"""
quickblock_type = models.ForeignKey(QuickBlockType,
quickblock_type = models.ForeignKey(QuickBlockType, on_delete=models.PROTECT,
verbose_name="Content Type",
help_text="The category, or type for this content block")

Expand Down Expand Up @@ -78,8 +81,12 @@ def sorted_images(self):
def __unicode__(self):
return self.title

def __str__(self):
return self.title


class QuickBlockImage(SmartModel):
quickblock = models.ForeignKey(QuickBlock, related_name='images')
quickblock = models.ForeignKey(QuickBlock, on_delete=models.PROTECT, related_name='images')
image = models.ImageField(upload_to='quickblock_images/', width_field="width", height_field="height")
caption = models.CharField(max_length=64)
priority = models.IntegerField(default=0, blank=True, null=True)
Expand All @@ -89,3 +96,6 @@ class QuickBlockImage(SmartModel):
def __unicode__(self):
return self.image.url

def __str__(self):
return self.image.url

119 changes: 119 additions & 0 deletions django_quickblocks/south_migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# -*- 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 'QuickBlockType'
db.create_table('django_quickblocks_quickblocktype', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='quickblocktype_creations', to=orm['auth.User'])),
('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='quickblocktype_modifications', to=orm['auth.User'])),
('modified_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=75)),
('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
))
db.send_create_signal('django_quickblocks', ['QuickBlockType'])

# Adding model 'QuickBlock'
db.create_table('django_quickblocks_quickblock', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='quickblock_creations', to=orm['auth.User'])),
('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='quickblock_modifications', to=orm['auth.User'])),
('modified_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('quickblock_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['django_quickblocks.QuickBlockType'])),
('title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
('content', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),
('link', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
('tags', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
('priority', self.gf('django.db.models.fields.IntegerField')(default=0)),
))
db.send_create_signal('django_quickblocks', ['QuickBlock'])


def backwards(self, orm):
# Deleting model 'QuickBlockType'
db.delete_table('django_quickblocks_quickblocktype')

# Deleting model 'QuickBlock'
db.delete_table('django_quickblocks_quickblock')


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'})
},
'django_quickblocks.quickblock': {
'Meta': {'object_name': 'QuickBlock'},
'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quickblock_creations'", 'to': "orm['auth.User']"}),
'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'link': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quickblock_modifications'", 'to': "orm['auth.User']"}),
'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'quickblock_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['django_quickblocks.QuickBlockType']"}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
},
'django_quickblocks.quickblocktype': {
'Meta': {'object_name': 'QuickBlockType'},
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quickblocktype_creations'", 'to': "orm['auth.User']"}),
'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quickblocktype_modifications'", 'to': "orm['auth.User']"}),
'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'})
}
}

complete_apps = ['django_quickblocks']
Empty file.
102 changes: 0 additions & 102 deletions django_quickblocks/static/css/bootstrap-wysihtml5.css

This file was deleted.

3 changes: 3 additions & 0 deletions django_quickblocks/static/css/bootstrap3-wysihtml5.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading