トップ 一覧 ping 検索 ヘルプ RSS ログイン

Google App Engine 型とプロパティクラスの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!Google App Engine 型とプロパティクラス
[Google App Engine]
*http://code.google.com/intl/ja/appengine/docs/python/datastore/typesandpropertyclasses.html

,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 MessageBoardCreate(webapp.RequestHandler):
 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