[tipfy] 5 new revisions pushed by rodrigo.moraes on 2011-03-30 11:20 GMT

0 views
Skip to first unread message

ti...@googlecode.com

unread,
Mar 30, 2011, 7:21:10 AM3/30/11
to tipfy-...@googlegroups.com
5 new revisions:

Revision: 8a5864b47c5d
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Sun Mar 20 04:11:43 2011
Log: Adds a DecimalProperty property type for App Engine....
http://code.google.com/p/tipfy/source/detail?r=8a5864b47c5d

Revision: abddb05dba8f
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 01:07:07 2011
Log: Merge branch 'master' of git://github.com/moraes/tipfy into
upstream-m...
http://code.google.com/p/tipfy/source/detail?r=abddb05dba8f

Revision: 9d0cbe2b7058
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 11:38:19 2011
Log: Merge branch 'master' of git://github.com/moraes/tipfy
http://code.google.com/p/tipfy/source/detail?r=9d0cbe2b7058

Revision: 62a71b4fef0a
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 11:41:29 2011
Log: Updates ignore rules to keep tipfy submodule "clean"....
http://code.google.com/p/tipfy/source/detail?r=62a71b4fef0a

Revision: 45d9b5015320
Author: Rodrigo Moraes <rodrigo...@gmail.com>
Date: Wed Mar 30 04:20:21 2011
Log: Added DecimalProperty. Thanks, gorakhargosh.
http://code.google.com/p/tipfy/source/detail?r=45d9b5015320

==============================================================================
Revision: 8a5864b47c5d
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Sun Mar 20 04:11:43 2011
Log: Adds a DecimalProperty property type for App Engine.

Signed-off-by: Yesudeep Mangalapilly <gora.k...@gmail.com>
http://code.google.com/p/tipfy/source/detail?r=8a5864b47c5d

Modified:
/tipfy/appengine/db/properties.py

=======================================
--- /tipfy/appengine/db/properties.py Sun Feb 6 07:35:23 2011
+++ /tipfy/appengine/db/properties.py Sun Mar 20 04:11:43 2011
@@ -10,6 +10,7 @@
"""
import hashlib
import pickle
+import decimal

from google.appengine.ext import db

@@ -204,3 +205,25 @@

raise db.BadValueError("Property %s must be a pytz timezone or
string."
% self.name)
+
+
+class DecimalProperty(db.Property):
+ """Stores a decimal value."""
+ data_type = decimal.Decimal
+
+ def get_value_for_datastore(self, model_instance):
+ return str(super(DecimalProperty, self).get_value_for_datastore(
+ model_instance))
+
+ def make_value_from_datastore(self, value):
+ return decimal.Decimal(value)
+
+ def validate(self, value):
+ value = super(DecimalProperty, self).validate(value)
+
+ if value is None or isinstance(value, decimal.Decimal):
+ return value
+ elif isinstance(value, basestring):
+ return decimal.Decimal(value)
+ raise db.BadValueError("Property %s must be a Decimal or string"
+ % self.name)

==============================================================================
Revision: abddb05dba8f
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 01:07:07 2011
Log: Merge branch 'master' of git://github.com/moraes/tipfy into
upstream-master
http://code.google.com/p/tipfy/source/detail?r=abddb05dba8f

==============================================================================
Revision: 9d0cbe2b7058
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 11:38:19 2011
Log: Merge branch 'master' of git://github.com/moraes/tipfy
http://code.google.com/p/tipfy/source/detail?r=9d0cbe2b7058

==============================================================================
Revision: 62a71b4fef0a
Author: Yesudeep Mangalapilly <gora.k...@gmail.com>
Date: Wed Mar 23 11:41:29 2011
Log: Updates ignore rules to keep tipfy submodule "clean".

Signed-off-by: Yesudeep Mangalapilly <gora.k...@gmail.com>
http://code.google.com/p/tipfy/source/detail?r=62a71b4fef0a

Modified:
/.gitignore

=======================================
--- /.gitignore Thu Oct 28 00:17:52 2010
+++ /.gitignore Wed Mar 23 11:41:29 2011
@@ -11,3 +11,7 @@
docs/project
tests/project

+# Using buildout with tipfy-git as submodule causes the tipfy
+# git repo to be "dirty". Ignore these files.
+tipfy.egg-info/
+

==============================================================================
Revision: 45d9b5015320
Author: Rodrigo Moraes <rodrigo...@gmail.com>
Date: Wed Mar 30 04:20:21 2011
Log: Added DecimalProperty. Thanks, gorakhargosh.
http://code.google.com/p/tipfy/source/detail?r=45d9b5015320


Reply all
Reply to author
Forward
0 new messages