From 34f98fe480417f6648a7fdac4c6d09b9905f86ae Mon Sep 17 00:00:00 2001 From: vaishk Date: Sat, 20 May 2017 18:15:26 +0530 Subject: [PATCH] content --- camp/settings.py | 1 + content/__init__.py | 0 content/admin.py | 27 +++ content/apps.py | 8 + content/migrations/__init__.py | 0 content/models.py | 203 +++++++++++++++++++++ content/tests.py | 6 + content/views.py | 6 + tempmodel.py | 316 +++++++++++++++++++++++++++++++++ 9 files changed, 567 insertions(+) create mode 100644 content/__init__.py create mode 100644 content/admin.py create mode 100644 content/apps.py create mode 100644 content/migrations/__init__.py create mode 100644 content/models.py create mode 100644 content/tests.py create mode 100644 content/views.py create mode 100644 tempmodel.py diff --git a/camp/settings.py b/camp/settings.py index 7987c97..12a8230 100644 --- a/camp/settings.py +++ b/camp/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'content', ] MIDDLEWARE = [ diff --git a/content/__init__.py b/content/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/content/admin.py b/content/admin.py new file mode 100644 index 0000000..f3413f9 --- /dev/null +++ b/content/admin.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. +from models import * + +''' +class SubdomainInline(admin.StackedInline): + model = Subdomain + +class DomainAliasInline(admin.StackedInline): + model = DomainAlias + +class ServerAdmin(admin.ModelAdmin): + pass +''' + +class ContentAdmin(admin.ModelAdmin): + save_on_top = True +# inlines = [SubdomainInline, DomainAliasInline] +# list_display = ('url', 'server', 'manage_nameserver', 'domain_registrar', 'email', 'is_active') +# list_editable = ('server', 'manage_nameserver', 'domain_registrar', 'email', 'is_active') + + +admin.site.register(Content, ContentAdmin) diff --git a/content/apps.py b/content/apps.py new file mode 100644 index 0000000..7196651 --- /dev/null +++ b/content/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class ContentConfig(AppConfig): + name = 'content' diff --git a/content/migrations/__init__.py b/content/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/content/models.py b/content/models.py new file mode 100644 index 0000000..d4a56cd --- /dev/null +++ b/content/models.py @@ -0,0 +1,203 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + +# Create your models here. + +class Acrolike(models.Model): + title = models.CharField(max_length=255) + + class Meta: + managed = False + db_table = 'acrolike' + + +class Acronym(models.Model): + name = models.CharField(max_length=255, blank=True, null=True) + c = models.CharField(max_length=50, blank=True, null=True) + a = models.CharField(max_length=50, blank=True, null=True) + m = models.CharField(max_length=50, blank=True, null=True) + p = models.CharField(max_length=50, blank=True, null=True) + + class Meta: + managed = False + db_table = 'acronym' + + +class Audios(models.Model): + filename = models.CharField(max_length=255) + title = models.CharField(max_length=255, blank=True, null=True) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'audios' + + + +class Comments(models.Model): #not used + comment = models.TextField() + name = models.CharField(max_length=150, blank=True, null=True) + email = models.CharField(max_length=255, blank=True, null=True) + personid = models.IntegerField(db_column='personID', blank=True, null=True) # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase. + parentid = models.IntegerField(db_column='parentID', blank=True, null=True) # Field name made lowercase. + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + ip = models.CharField(db_column='IP', max_length=50, blank=True, null=True) # Field name made lowercase. + + class Meta: + managed = False + db_table = 'comments' + + +class Content(models.Model): + shortname = models.CharField(db_column='shortName', max_length=255) # Field name made lowercase. + title = models.CharField(max_length=255) + header = models.TextField(blank=True, null=True) + body = models.TextField(blank=True, null=True) + schedule = models.TextField(blank=True, null=True) + schedulebutton = models.CharField(db_column='scheduleButton', max_length=255, blank=True, null=True) # Field name made lowercase. + optbtn2 = models.CharField(db_column='optBtn2', max_length=127, blank=True, null=True) # Field name made lowercase. + opttext2 = models.TextField(db_column='optText2', blank=True, null=True) # Field name made lowercase. + optbtn3 = models.CharField(db_column='optBtn3', max_length=127, blank=True, null=True) # Field name made lowercase. + opttext3 = models.TextField(db_column='optText3', blank=True, null=True) # Field name made lowercase. + technotes = models.TextField() + image = models.CharField(max_length=150, blank=True, null=True) + postedby = models.CharField(db_column='postedBy', max_length=50, blank=True, null=True) # Field name made lowercase. + datestart = models.DateField(db_column='dateStart', blank=True, null=True) # Field name made lowercase. + dateend = models.DateField(db_column='dateEnd', blank=True, null=True) # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase. + type = models.IntegerField() + published = models.IntegerField() + view = models.IntegerField(blank=True, null=True) + parentid = models.IntegerField(db_column='parentId') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content' + + +class ContentContent(models.Model): + contentid1 = models.IntegerField(db_column='contentID1') # Field name made lowercase. + contentid2 = models.IntegerField(db_column='contentID2') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_content' + + +class ContentKeyword(models.Model): + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + keywordid = models.IntegerField(db_column='keywordID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_keyword' + + +class ContentResource(models.Model): + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + resourceid = models.IntegerField(db_column='resourceID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_resource' + + +class ContentTypes(models.Model): + id = models.IntegerField(primary_key=True) + name = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'content_types' + + +class Keywords(models.Model): + name = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'keywords' + + +class People(models.Model): #not used + name = models.CharField(max_length=255, blank=True, null=True) + email = models.CharField(max_length=255, blank=True, null=True) + location = models.CharField(max_length=255, blank=True, null=True) + login = models.CharField(max_length=100, blank=True, null=True) + password = models.CharField(max_length=16, blank=True, null=True) + href = models.CharField(max_length=255, blank=True, null=True) + bio = models.TextField(blank=True, null=True) + type = models.IntegerField() + + class Meta: + managed = False + db_table = 'people' + + +class PersonContent(models.Model): + personid = models.IntegerField(db_column='personID') # Field name made lowercase. + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + level = models.IntegerField() + + class Meta: + managed = False + db_table = 'person_content' + + +class PersonResource(models.Model): + personid = models.IntegerField(db_column='personID') # Field name made lowercase. + resourceid = models.IntegerField(db_column='resourceID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'person_resource' + + +class Resources(models.Model): + type = models.IntegerField() + href = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + mime = models.CharField(max_length=10, blank=True, null=True) + width = models.IntegerField(blank=True, null=True) + height = models.IntegerField(blank=True, null=True) + istech = models.IntegerField(db_column='isTech') # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + orderno = models.IntegerField(db_column='orderNo', blank=True, null=True) # Field name made lowercase. + + class Meta: + managed = False + db_table = 'resources' + + +class Videos(models.Model): # not used + sha1 = models.CharField(max_length=50) + href = models.CharField(max_length=255) + title = models.TextField(blank=True, null=True) + description = models.TextField(blank=True, null=True) + width = models.IntegerField(blank=True, null=True) + height = models.IntegerField(blank=True, null=True) + duration = models.IntegerField(blank=True, null=True) + thumbno = models.IntegerField(db_column='thumbNo') # Field name made lowercase. + image = models.CharField(max_length=255, blank=True, null=True) + contentid = models.IntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'videos' + + +class Views(models.Model): + name = models.CharField(max_length=255) + href = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = False + db_table = 'views' + diff --git a/content/tests.py b/content/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/content/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/content/views.py b/content/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/content/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tempmodel.py b/tempmodel.py new file mode 100644 index 0000000..c08e907 --- /dev/null +++ b/tempmodel.py @@ -0,0 +1,316 @@ +# This is an auto-generated Django model module. +# You'll have to do the following manually to clean this up: +# * Rearrange models' order +# * Make sure each model has one field with primary_key=True +# * Make sure each ForeignKey has `on_delete` set to the desired behavior. +# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table +# Feel free to rename the models, but don't rename db_table values or field names. +from __future__ import unicode_literals + +from django.db import models + + +class Acrolike(models.Model): + title = models.CharField(max_length=255) + + class Meta: + managed = False + db_table = 'acrolike' + + +class Acronym(models.Model): + name = models.CharField(max_length=255, blank=True, null=True) + c = models.CharField(max_length=50, blank=True, null=True) + a = models.CharField(max_length=50, blank=True, null=True) + m = models.CharField(max_length=50, blank=True, null=True) + p = models.CharField(max_length=50, blank=True, null=True) + + class Meta: + managed = False + db_table = 'acronym' + + +class Audios(models.Model): + filename = models.CharField(max_length=255) + title = models.CharField(max_length=255, blank=True, null=True) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'audios' + + +class AuthGroup(models.Model): + name = models.CharField(unique=True, max_length=80) + + class Meta: + managed = False + db_table = 'auth_group' + + +class AuthGroupPermissions(models.Model): + group_id = models.IntegerField() + permission_id = models.IntegerField() + + class Meta: + managed = False + db_table = 'auth_group_permissions' + unique_together = (('group_id', 'permission_id'),) + + +class AuthPermission(models.Model): + name = models.CharField(max_length=50) + content_type_id = models.IntegerField() + codename = models.CharField(max_length=100) + + class Meta: + managed = False + db_table = 'auth_permission' + unique_together = (('content_type_id', 'codename'),) + + +class AuthUser(models.Model): + username = models.CharField(unique=True, max_length=30) + first_name = models.CharField(max_length=30) + last_name = models.CharField(max_length=30) + email = models.CharField(max_length=75) + password = models.CharField(max_length=128) + is_staff = models.IntegerField() + is_active = models.IntegerField() + is_superuser = models.IntegerField() + last_login = models.DateTimeField() + date_joined = models.DateTimeField() + + class Meta: + managed = False + db_table = 'auth_user' + + +class AuthUserGroups(models.Model): + user_id = models.IntegerField() + group_id = models.IntegerField() + + class Meta: + managed = False + db_table = 'auth_user_groups' + unique_together = (('user_id', 'group_id'),) + + +class AuthUserUserPermissions(models.Model): + user_id = models.IntegerField() + permission_id = models.IntegerField() + + class Meta: + managed = False + db_table = 'auth_user_user_permissions' + unique_together = (('user_id', 'permission_id'),) + + +class Comments(models.Model): + comment = models.TextField() + name = models.CharField(max_length=150, blank=True, null=True) + email = models.CharField(max_length=255, blank=True, null=True) + personid = models.IntegerField(db_column='personID', blank=True, null=True) # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase. + parentid = models.IntegerField(db_column='parentID', blank=True, null=True) # Field name made lowercase. + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + ip = models.CharField(db_column='IP', max_length=50, blank=True, null=True) # Field name made lowercase. + + class Meta: + managed = False + db_table = 'comments' + + +class Content(models.Model): + shortname = models.CharField(db_column='shortName', max_length=255) # Field name made lowercase. + title = models.CharField(max_length=255) + header = models.TextField(blank=True, null=True) + body = models.TextField(blank=True, null=True) + schedule = models.TextField(blank=True, null=True) + schedulebutton = models.CharField(db_column='scheduleButton', max_length=255, blank=True, null=True) # Field name made lowercase. + optbtn2 = models.CharField(db_column='optBtn2', max_length=127, blank=True, null=True) # Field name made lowercase. + opttext2 = models.TextField(db_column='optText2', blank=True, null=True) # Field name made lowercase. + optbtn3 = models.CharField(db_column='optBtn3', max_length=127, blank=True, null=True) # Field name made lowercase. + opttext3 = models.TextField(db_column='optText3', blank=True, null=True) # Field name made lowercase. + technotes = models.TextField() + image = models.CharField(max_length=150, blank=True, null=True) + postedby = models.CharField(db_column='postedBy', max_length=50, blank=True, null=True) # Field name made lowercase. + datestart = models.DateField(db_column='dateStart', blank=True, null=True) # Field name made lowercase. + dateend = models.DateField(db_column='dateEnd', blank=True, null=True) # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase. + type = models.IntegerField() + published = models.IntegerField() + view = models.IntegerField(blank=True, null=True) + parentid = models.IntegerField(db_column='parentId') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content' + + +class ContentContent(models.Model): + contentid1 = models.IntegerField(db_column='contentID1') # Field name made lowercase. + contentid2 = models.IntegerField(db_column='contentID2') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_content' + + +class ContentKeyword(models.Model): + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + keywordid = models.IntegerField(db_column='keywordID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_keyword' + + +class ContentResource(models.Model): + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + resourceid = models.IntegerField(db_column='resourceID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'content_resource' + + +class ContentTypes(models.Model): + id = models.IntegerField(primary_key=True) + name = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'content_types' + + +class DjangoAdminLog(models.Model): + action_time = models.DateTimeField() + user_id = models.IntegerField() + content_type_id = models.IntegerField(blank=True, null=True) + object_id = models.TextField(blank=True, null=True) + object_repr = models.CharField(max_length=200) + action_flag = models.SmallIntegerField() + change_message = models.TextField() + + class Meta: + managed = False + db_table = 'django_admin_log' + + +class DjangoContentType(models.Model): + name = models.CharField(max_length=100) + app_label = models.CharField(max_length=100) + model = models.CharField(max_length=100) + + class Meta: + managed = False + db_table = 'django_content_type' + unique_together = (('app_label', 'model'),) + + +class DjangoSession(models.Model): + session_key = models.CharField(primary_key=True, max_length=40) + session_data = models.TextField() + expire_date = models.DateTimeField() + + class Meta: + managed = False + db_table = 'django_session' + + +class DjangoSite(models.Model): + domain = models.CharField(max_length=100) + name = models.CharField(max_length=50) + + class Meta: + managed = False + db_table = 'django_site' + + +class Keywords(models.Model): + name = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'keywords' + + +class People(models.Model): + name = models.CharField(max_length=255, blank=True, null=True) + email = models.CharField(max_length=255, blank=True, null=True) + location = models.CharField(max_length=255, blank=True, null=True) + login = models.CharField(max_length=100, blank=True, null=True) + password = models.CharField(max_length=16, blank=True, null=True) + href = models.CharField(max_length=255, blank=True, null=True) + bio = models.TextField(blank=True, null=True) + type = models.IntegerField() + + class Meta: + managed = False + db_table = 'people' + + +class PersonContent(models.Model): + personid = models.IntegerField(db_column='personID') # Field name made lowercase. + contentid = models.IntegerField(db_column='contentID') # Field name made lowercase. + level = models.IntegerField() + + class Meta: + managed = False + db_table = 'person_content' + + +class PersonResource(models.Model): + personid = models.IntegerField(db_column='personID') # Field name made lowercase. + resourceid = models.IntegerField(db_column='resourceID') # Field name made lowercase. + + class Meta: + managed = False + db_table = 'person_resource' + + +class Resources(models.Model): + type = models.IntegerField() + href = models.CharField(max_length=255) + description = models.TextField(blank=True, null=True) + mime = models.CharField(max_length=10, blank=True, null=True) + width = models.IntegerField(blank=True, null=True) + height = models.IntegerField(blank=True, null=True) + istech = models.IntegerField(db_column='isTech') # Field name made lowercase. + dateadded = models.DateTimeField(db_column='dateAdded') # Field name made lowercase. + orderno = models.IntegerField(db_column='orderNo', blank=True, null=True) # Field name made lowercase. + + class Meta: + managed = False + db_table = 'resources' + + +class Videos(models.Model): + sha1 = models.CharField(max_length=50) + href = models.CharField(max_length=255) + title = models.TextField(blank=True, null=True) + description = models.TextField(blank=True, null=True) + width = models.IntegerField(blank=True, null=True) + height = models.IntegerField(blank=True, null=True) + duration = models.IntegerField(blank=True, null=True) + thumbno = models.IntegerField(db_column='thumbNo') # Field name made lowercase. + image = models.CharField(max_length=255, blank=True, null=True) + contentid = models.IntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'videos' + + +class Views(models.Model): + name = models.CharField(max_length=255) + href = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = False + db_table = 'views'