Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: appengine/components/components/datastore_utils/properties.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The LUCI Authors. All rights reserved. 1 # Copyright 2014 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Useful custom properties.""" 5 """Useful custom properties."""
6 6
7 import json 7 import json
8 8
9 from google.appengine.ext import ndb 9 from google.appengine.ext import ndb
10 10
11 from components import utils 11 from components import utils
12 12
13 13
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 # which property is incorrect. 58 # which property is incorrect.
59 raise TypeError( 59 raise TypeError(
60 'Property %s must be a %s' % (self._name, self._json_type)) 60 'Property %s must be a %s' % (self._name, self._json_type))
61 61
62 def _to_base_type(self, value): 62 def _to_base_type(self, value):
63 """Makes it deterministic compared to ndb.JsonProperty._to_base_type().""" 63 """Makes it deterministic compared to ndb.JsonProperty._to_base_type()."""
64 return utils.encode_to_json(value) 64 return utils.encode_to_json(value)
65 65
66 def _from_base_type(self, value): 66 def _from_base_type(self, value):
67 return json.loads(value) 67 return json.loads(value)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698