aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/models.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-03-26 09:10:04 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-03-26 09:10:04 -0500
commitfc9bb821eaac0f615eee690cd2473360ed6cbb64 (patch)
tree51e283f975a507e470b4974b4170b934496baa47 /mediagoblin/models.py
parentdb61f7d15255b7f9bf697108be2175018a780810 (diff)
downloadmediagoblin-fc9bb821eaac0f615eee690cd2473360ed6cbb64.tar.lz
mediagoblin-fc9bb821eaac0f615eee690cd2473360ed6cbb64.tar.xz
mediagoblin-fc9bb821eaac0f615eee690cd2473360ed6cbb64.zip
required_values, default_values! For the only two models we have.
Diffstat (limited to 'mediagoblin/models.py')
-rw-r--r--mediagoblin/models.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mediagoblin/models.py b/mediagoblin/models.py
index 07d841bf..b14ada9f 100644
--- a/mediagoblin/models.py
+++ b/mediagoblin/models.py
@@ -13,6 +13,13 @@ class MediaEntry(Document):
'file_store': unicode,
'tags': Set(unicode)}
+ required_fields = [
+ 'title', 'created',
+ 'media_type', 'file_store']
+
+ default_values = {
+ 'date_creation':datetime.datetime.utcnow}
+
class User(Document):
structure = {
@@ -22,6 +29,12 @@ class User(Document):
'pw_hash': unicode,
}
+ required_fields = ['username', 'created', 'pw_hash']
+
+ default_values = {
+ 'date_creation':datetime.datetime.utcnow}
+
+
REGISTER_MODELS = [MediaEntry, User]