From d232e0f6be4be977634f1a2bbd39ca401dfb296d Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 24 Mar 2011 20:19:25 -0500 Subject: [PATCH] Adding a skeletal models.py --- mediagoblin/models.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 mediagoblin/models.py diff --git a/mediagoblin/models.py b/mediagoblin/models.py new file mode 100644 index 00000000..3471ddc7 --- /dev/null +++ b/mediagoblin/models.py @@ -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