「Google App Engine 型とプロパティクラス」の版間の差分
ナビゲーションに移動
検索に移動
| 1行目: | 1行目: | ||
==Google App Engine 型とプロパティクラス== | ==Google App Engine 型とプロパティクラス== | ||
| − | [[Google App Engine]] | + | [[Google App Engine]] | |
*http://code.google.com/intl/ja/appengine/docs/python/datastore/typesandpropertyclasses.html | *http://code.google.com/intl/ja/appengine/docs/python/datastore/typesandpropertyclasses.html | ||
2020年2月15日 (土) 08:36時点における版
Google App Engine 型とプロパティクラス
| Property クラス | 値型 | 並び替え順序 |
|---|---|---|
| StringProperty | str/unicode | Unicode(str は ASCII として処理されます) |
| ByteStringProperty | ByteString | バイト順 |
| BooleanProperty | bool | False < True |
| IntegerProperty | int/long | 数値 |
| FloatProperty | float | 数値 |
| DateTimeProperty/DateProperty/TimeProperty | datetime.datetime | 時系列 |
| ListProperty/StringListProperty | サポートされる型の list | 昇順なら最小要素単位、降順なら最大要素単位 |
| ReferenceProperty/SelfReferenceProperty | db.Key | パス要素単位(種類、ID、名前のいずれか、種類、ID、名前のいずれか...) |
| UserProperty | users.User | メール アドレス(Unicode) |
| BlobProperty | db.Blob | (順序付け不可) |
| TextProperty | db.Text | (順序付け不可) |
| CategoryProperty | db.Category | Unicode |
| LinkProperty | db.Link | Unicode |
| EmailProperty | db.Email | Unicode |
| GeoPtProperty | db.GeoPt | 緯度の後に経度 |
| IMProperty | db.IM | Unicode |
| PhoneNumberProperty | db.PhoneNumber | Unicode |
| PostalAddressProperty | db.PostalAddress | Unicode |
| RatingProperty | db.Rating | 数値 |
GeoPtProperty
設定
from google.appengine.ext import db
class SetGeoPtToHoge(webapp.RequestHandler):
def get(self):
lat = self.request.get('lat')
lon = self.request.get('lon')
hoge = Hoge()
hoge.geo_pt = db.GeoPt(lat, lon)
:
取得
lat = hoge.geo_pt.lat lon = hoge.geo_pt.lon
© 2006 矢木浩人