def get_numbers(needed):
    query = gaetkSequence.all(keys_only=True).filter('active = ', True)
return db.run_in_transaction(_get_numbers_helper, query.fetch(5), needed)
How to implement "autoincrement" on Google AppEngine