Adding a skeletal models.py

This commit is contained in:
Christopher Allan Webber 2011-03-24 20:19:25 -05:00
parent 508775bd23
commit d232e0f6be

32
mediagoblin/models.py Normal file
View 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