Commit 78b56ef3 by Őry Máté

store: remove ModelDict

parent 4481493e
......@@ -175,6 +175,17 @@ import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'
store_settings = {
"basic_auth": "True",
"verify_ssl": "False",
"ssl_auth": "False",
"store_client_pass": "IQu8Eice",
"store_client_user": "admin",
"store_client_key": "/opt/webadmin/cloud/client.key",
"store_client_cert": "/opt/webadmin/cloud/client.crt",
"store_url": "http://localhost:9000",
}
try:
from cloud.local_settings import *
except:
......
......@@ -44,70 +44,6 @@
}
},
{
"pk": 1,
"model": "store.setting",
"fields": {
"value": "True",
"key": "basic_auth"
}
},
{
"pk": 2,
"model": "store.setting",
"fields": {
"value": "False",
"key": "verify_ssl"
}
},
{
"pk": 3,
"model": "store.setting",
"fields": {
"value": "False",
"key": "ssl_auth"
}
},
{
"pk": 4,
"model": "store.setting",
"fields": {
"value": "IQu8Eice",
"key": "store_client_pass"
}
},
{
"pk": 5,
"model": "store.setting",
"fields": {
"value": "admin",
"key": "store_client_user"
}
},
{
"pk": 6,
"model": "store.setting",
"fields": {
"value": "/opt/webadmin/cloud/client.key",
"key": "store_client_key"
}
},
{
"pk": 7,
"model": "store.setting",
"fields": {
"value": "/opt/webadmin/cloud/client.crt",
"key": "store_client_cert"
}
},
{
"pk": 8,
"model": "store.setting",
"fields": {
"value": "http://localhost:9000",
"key": "store_url"
}
},
{
"pk": 2,
"model": "one.network",
"fields": {
......
from django.contrib import admin
from store.models import *
class SettingAdmin(admin.ModelAdmin):
list_display = ('key', 'value')
admin.site.register(Setting, SettingAdmin)
from django.db import models
from django.http import Http404
import json, requests, time
from modeldict import ModelDict
from store.models import settings
from cloud.settings import store_settings as settings
# Create your models here.
#TODO Handle exceptions locally
......
# -*- 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):
# Deleting model 'Setting'
db.delete_table('store_setting')
def backwards(self, orm):
# Adding model 'Setting'
db.create_table('store_setting', (
('value', self.gf('django.db.models.fields.CharField')(max_length=200)),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('key', self.gf('django.db.models.fields.CharField')(max_length=32)),
))
db.send_create_signal('store', ['Setting'])
models = {
}
complete_apps = ['store']
\ No newline at end of file
from django.db import models
from modeldict import ModelDict
class Setting(models.Model):
key = models.CharField(max_length=32)
value = models.CharField(max_length=200)
settings = ModelDict(Setting, key='key', value='value', instances=False)
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment