gae アプリ 開発メモ

Google App Engine アプリの開発メモ / 言語: python, javascript / ビギナー

2012-02-22から1日間の記事一覧

htmlのnameトークンに使える文字

出典:HTMLの基本データ形式 IDトークンとNAMEトークンは、アルファベット([A-Za-z])で開始し、任意の数のアルファベット、数字、([0-9])、ハイフン(-)、アンダースコア(_)、コロン、(:)、ピリオド(.)のみで記述する必要がある。

キーの範囲検索

Model: Abc の中から key_name 'abc-key:00000'~'abc-key:99999'を探したい時 key_first = db.Key.from_path('Abc', 'abc-key:') key_last = db.Key.from_path('Abc', 'abc-key;') # ASCIIコードで ':' の次 ';' fields = Abc.all().filter('__key__ >', ke…

db.Expandoの動的プロパティは必ずindexed=True

setattr() で indexed = False なプロパティを突っ込めばイケるか? なんて期待は簡単に裏切られた。 from google.appengine.ext import db class Person(db.Expando): pass person = Person() name_value = db.StringProperty(required = True, indexed = F…

sordted()は安定ソート

安定ソートか確認 import random import operator def test_list_sort(): class Person(object): def __init__(self, name, age): self.name = name self.age = age def __repr__(self): return repr((self.name, self.age)) persons = [] for n in range(10…