diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-03-24 20:19:25 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-03-24 20:19:25 -0500 |
commit | d232e0f6be4be977634f1a2bbd39ca401dfb296d (patch) | |
tree | 6d781fd35e029bb6d710f0f121c08ffb8f294f71 /mediagoblin/models.py | |
parent | 508775bd2360c441bde1045bc89abe4152e72650 (diff) | |
download | mediagoblin-d232e0f6be4be977634f1a2bbd39ca401dfb296d.tar.lz mediagoblin-d232e0f6be4be977634f1a2bbd39ca401dfb296d.tar.xz mediagoblin-d232e0f6be4be977634f1a2bbd39ca401dfb296d.zip |
Adding a skeletal models.py
Diffstat (limited to 'mediagoblin/models.py')
-rw-r--r-- | mediagoblin/models.py | 32 |
1 files changed, 32 insertions, 0 deletions
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 |