Adding a skeletal models.py
This commit is contained in:
parent
508775bd23
commit
d232e0f6be
32
mediagoblin/models.py
Normal file
32
mediagoblin/models.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
from mongokit import Document, Set
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
|
class MediaEntry(Document):
|
||||||
|
structure = {
|
||||||
|
'title': unicode,
|
||||||
|
'created': datetime.datetime,
|
||||||
|
'description': unicode,
|
||||||
|
'media_type': unicode,
|
||||||
|
'media_data': dict, # extra data relevant to this media_type
|
||||||
|
'plugin_data': dict, # plugins can dump stuff here.
|
||||||
|
'file_store': unicode,
|
||||||
|
'tags': Set(unicode)}
|
||||||
|
|
||||||
|
|
||||||
|
class User(Document):
|
||||||
|
structure = {
|
||||||
|
'username': unicode,
|
||||||
|
'created': datetime.datetime,
|
||||||
|
'plugin_data': dict, # plugins can dump stuff here.
|
||||||
|
'pw_hash': unicode,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
REGISTER_MODELS = [MediaEntry, User]
|
||||||
|
|
||||||
|
def register_models(connection):
|
||||||
|
"""
|
||||||
|
Register all models in REGISTER_MODELS with this connection.
|
||||||
|
"""
|
||||||
|
pass
|
Loading…
x
Reference in New Issue
Block a user