basic data model

This commit is contained in:
Frédéric Péters 2014-12-07 15:34:30 +01:00
parent aa26f9a6e2
commit b1f02408c0
8 changed files with 41 additions and 20 deletions

View File

@ -1,3 +0,0 @@
from django.contrib import admin
# Register your models here.

View File

@ -1,3 +1,34 @@
from django.db import models
# combo - content management system
# Copyright (C) 2014 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Create your models here.
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ckeditor.fields import RichTextField
class Page(models.Model):
title = models.CharField(_('Title'), max_length=50)
slug = models.SlugField()
class CellBase(models.Model):
page = models.ForeignKey(Page)
order = models.PositiveIntegerField()
class TextCell(CellBase):
text = RichTextField(_('Text'), null=True)

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -1,3 +0,0 @@
from django.shortcuts import render
# Create your views here.

View File

@ -36,6 +36,8 @@ INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'ckeditor',
'combo.data',
)
MIDDLEWARE_CLASSES = (
@ -80,3 +82,5 @@ USE_TZ = True
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
CKEDITOR_UPLOAD_PATH = os.path.join(BASE_DIR, 'uploads/ckeditor')

View File

@ -1,12 +1,4 @@
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'combo.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)

View File

@ -1 +1,2 @@
Django==1.6
django-ckeditor

View File

@ -57,6 +57,8 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2',
],
install_requires=['django == 1.6',],
install_requires=['django == 1.6',
'django-ckeditor',
],
zip_safe=False,
)