Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78b56ef3
authored
Feb 04, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store: remove ModelDict
parent
4481493e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
77 deletions
+43
-77
cloud/settings.py
+11
-0
miscellaneous/devenv/dev.json
+0
-64
store/admin.py
+0
-4
store/api.py
+1
-2
store/migrations/0002_auto__del_setting.py
+30
-0
store/models.py
+1
-7
No files found.
cloud/settings.py
View file @
78b56ef3
...
...
@@ -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
:
...
...
miscellaneous/devenv/dev.json
View file @
78b56ef3
...
...
@@ -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"
:
{
...
...
store/admin.py
View file @
78b56ef3
from
django.contrib
import
admin
from
store.models
import
*
class
SettingAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'key'
,
'value'
)
admin
.
site
.
register
(
Setting
,
SettingAdmin
)
store/api.py
View file @
78b56ef3
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
...
...
store/migrations/0002_auto__del_setting.py
0 → 100644
View file @
78b56ef3
# -*- 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
store/models.py
View file @
78b56ef3
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment