def index(self, account=None): if account is None and self.account.is_authenticated: return self.redirect(url('collections:collections:', account=self.account.id)) self.master_account = account master_account_items = None last_items = [] if self.master_account: master_account_items = AccountItemsPrototype.get_by_account_id(self.master_account.id) last_items = master_account_items.last_items(number=collections_settings.LAST_ITEMS_NUMBER) account_items = None if self.account.is_authenticated: account_items = AccountItemsPrototype.get_by_account_id(self.account.id) collections_statistics = get_collections_statistics(account_items=master_account_items) collections_table = split_into_table(self.collections, 3) return self.template('collections/collections/index.html', {'collections_statistics': collections_statistics, 'collections_table': collections_table, 'account_items': account_items, 'master_account_items': master_account_items, 'last_items': last_items})
def index(self, account=None): if account is None and self.account.is_authenticated: return self.redirect( url('collections:collections:', account=self.account.id)) self.master_account = account master_account_items = None last_items = [] if self.master_account: master_account_items = AccountItemsPrototype.get_by_account_id( self.master_account.id) last_items = master_account_items.last_items( number=collections_settings.LAST_ITEMS_NUMBER) account_items = None if self.account.is_authenticated: account_items = AccountItemsPrototype.get_by_account_id( self.account.id) collections_statistics = get_collections_statistics( account_items=master_account_items) collections_table = split_into_table(self.collections, 3) return self.template( 'collections/collections/index.html', { 'collections_statistics': collections_statistics, 'collections_table': collections_table, 'account_items': account_items, 'master_account_items': master_account_items, 'last_items': last_items })
def show(self, account=None): if account is None and self.account.is_authenticated: return self.redirect( url('collections:collections:show', self.collection.id, account=self.account.id)) self.master_account = account master_account_items = None if self.master_account: master_account_items = AccountItemsPrototype.get_by_account_id( self.master_account.id) account_items = None if self.account.is_authenticated: account_items = AccountItemsPrototype.get_by_account_id( self.account.id) collections_statistics = get_collections_statistics( account_items=master_account_items) kits = sorted([ kit for kit in kits_storage.all() if kit.collection_id == self.collection.id ], key=lambda k: k.caption) if not (self.can_edit_kit or self.can_moderate_kit): kits = [kit for kit in kits if kit.approved] items = {kit.id: [] for kit in kits} items_query = items_storage.all() if not self.edit_item_permission and not self.moderate_item_permission: items_query = (item for item in items_query if item.approved) items_query = sorted( [item for item in items_query if item.kit_id in items], key=lambda i: i.caption) for item in items_query: items[item.kit_id].append(item) return self.template( 'collections/collections/show.html', { 'kits': kits, 'items': items, 'account_items': account_items, 'master_account_items': master_account_items, 'collections_statistics': collections_statistics })
def get_account_info(account, hero): from the_tale.game.ratings import prototypes as ratings_prototypes from the_tale.game.ratings import relations as ratings_relations ratings = {} rating_places = ratings_prototypes.RatingPlacesPrototype.get_by_account_id(account.id) rating_values = ratings_prototypes.RatingValuesPrototype.get_by_account_id(account.id) if rating_values and rating_places: for rating in ratings_relations.RATING_TYPE.records: ratings[rating.value] = {'name': rating.text, 'place': getattr(rating_places, '%s_place' % rating.field, None), 'value': getattr(rating_values, rating.field, None)} places_history = [{'place': {'id': place.id, 'name': place.name}, 'count': help_count} for place, help_count in hero.places_history.get_most_common_places()] return {'id': account.id, 'registered': not account.is_fast, 'name': account.nick_verbose, 'hero_id': hero.id, 'places_history': places_history, 'might': account.might, 'achievements': AccountAchievementsPrototype.get_by_account_id(account.id).points, 'collections': AccountItemsPrototype.get_by_account_id(account.id).get_items_count(), 'referrals': account.referrals_number, 'ratings': ratings, 'permissions': { 'can_affect_game': account.can_affect_game }, 'description': account.description_html}
def setUp(self): super(ItemsManagerTests, self).setUp() create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.collection_1 = CollectionPrototype.create(caption='collection_1', description='description_1') self.collection_2 = CollectionPrototype.create(caption='collection_2', description='description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption='kit_1', description='description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption='kit_2', description='description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption='kit_3', description='description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption='item_1_1', text='text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption='item_1_2', text='text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption='item_2_1', text='text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption='item_2_2', text='text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption='item_3_1', text='text_3_1', approved=True) self.account_1_items.add_item(self.item_1_2) self.account_1_items.save() self.worker = environment.workers.items_manager self.worker.initialize()
def setUp(self): super(ItemsManagerTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.collection_1 = CollectionPrototype.create(caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create(caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption=u'kit_3', description=u'description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_2', text=u'text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption=u'item_3_1', text=u'text_3_1', approved=True) self.account_1_items.add_item(self.item_1_2) self.account_1_items.save() self.worker = environment.workers.items_manager self.worker.initialize()
def setUp(self): super(ItemsManagerTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id( self.account_1.id) self.collection_1 = CollectionPrototype.create( caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create( caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption=u'kit_3', description=u'description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_2', text=u'text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption=u'item_3_1', text=u'text_3_1', approved=True) self.account_1_items.add_item(self.item_1_2) self.account_1_items.save() self.worker = environment.workers.items_manager self.worker.initialize()
def setUp(self): super(BaseRequestTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_2', '*****@*****.**', '111111') self.account_2 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_3', '*****@*****.**', '111111') self.account_3 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_4', '*****@*****.**', '111111') self.account_4 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.account_2_items = AccountItemsPrototype.get_by_account_id(self.account_2.id) self.account_3_items = AccountItemsPrototype.get_by_account_id(self.account_3.id) group_edit_kit = sync_group('edit kit', ['collections.edit_kit']) group_edit = sync_group('edit collection', ['collections.edit_collection']) group_edit_item = sync_group('edit item', ['collections.edit_item']) group_moderate = sync_group('moderate collection', ['collections.moderate_collection']) group_moderate_kit = sync_group('moderate kit', ['collections.moderate_kit']) group_moderate_item = sync_group('moderate item', ['collections.moderate_item']) group_edit_kit.user_set.add(self.account_2._model) group_edit.user_set.add(self.account_2._model) group_edit_item.user_set.add(self.account_2._model) group_moderate.user_set.add(self.account_3._model) group_moderate_kit.user_set.add(self.account_3._model) group_moderate_item.user_set.add(self.account_3._model) self.collection_1 = CollectionPrototype.create(caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create(caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'item_text_1_1') self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'item_text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'item_text_2_1', approved=True)
def handle(self, *args, **options): for achievements in models.AccountAchievements.objects.all().iterator(): prototype = prototypes.AccountAchievementsPrototype(achievements) collection = AccountItemsPrototype.get_by_account_id(prototype.account_id) for achievement_id in prototype.achievements.achievements_ids(): for item in storage.achievements_storage[achievement_id].rewards: if not collection.has_item(item): GiveItemTaskPrototype.create(prototype.account_id, item.id)
def show(self, account=None): if account is None and self.account.is_authenticated: return self.redirect(url('collections:collections:show', self.collection.id, account=self.account.id)) self.master_account = account master_account_items = None if self.master_account: master_account_items = AccountItemsPrototype.get_by_account_id(self.master_account.id) account_items = None if self.account.is_authenticated: account_items = AccountItemsPrototype.get_by_account_id(self.account.id) collections_statistics = get_collections_statistics(account_items=master_account_items) kits = sorted([kit for kit in kits_storage.all() if kit.collection_id == self.collection.id], key=lambda k: k.caption) if not (self.can_edit_kit or self.can_moderate_kit): kits = [kit for kit in kits if kit.approved] items = {kit.id: [] for kit in kits} items_query = items_storage.all() if not self.edit_item_permission and not self.moderate_item_permission: items_query = (item for item in items_query if item.approved) items_query = sorted([item for item in items_query if item.kit_id in items], key=lambda i: i.caption) for item in items_query: items[item.kit_id].append(item) return self.template('collections/collections/show.html', {'kits': kits, 'items': items, 'account_items': account_items, 'master_account_items': master_account_items, 'collections_statistics': collections_statistics})
def setUp(self): super(LogicTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id( self.account_1.id) self.collection_1 = CollectionPrototype.create( caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create( caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption=u'kit_3', description=u'description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_2', text=u'text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption=u'item_3_1', text=u'text_3_1', approved=True)
def setUp(self): super(BaseRequestTests, self).setUp() create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_2 = self.accounts_factory.create_account() self.account_3 = self.accounts_factory.create_account() self.account_4 = self.accounts_factory.create_account() self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.account_2_items = AccountItemsPrototype.get_by_account_id(self.account_2.id) self.account_3_items = AccountItemsPrototype.get_by_account_id(self.account_3.id) group_edit_kit = sync_group('edit kit', ['collections.edit_kit']) group_edit = sync_group('edit collection', ['collections.edit_collection']) group_edit_item = sync_group('edit item', ['collections.edit_item']) group_moderate = sync_group('moderate collection', ['collections.moderate_collection']) group_moderate_kit = sync_group('moderate kit', ['collections.moderate_kit']) group_moderate_item = sync_group('moderate item', ['collections.moderate_item']) group_edit_kit.user_set.add(self.account_2._model) group_edit.user_set.add(self.account_2._model) group_edit_item.user_set.add(self.account_2._model) group_moderate.user_set.add(self.account_3._model) group_moderate_kit.user_set.add(self.account_3._model) group_moderate_item.user_set.add(self.account_3._model) self.collection_1 = CollectionPrototype.create(caption='collection_1', description='description_1') self.collection_2 = CollectionPrototype.create(caption='collection_2', description='description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption='kit_1', description='description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption='kit_2', description='description_2', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption='item_1_1', text='item_text_1_1') self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption='item_1_2', text='item_text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption='item_2_1', text='item_text_2_1', approved=True)
def handle(self, *args, **options): for achievements in models.AccountAchievements.objects.all().iterator( ): prototype = prototypes.AccountAchievementsPrototype(achievements) collection = AccountItemsPrototype.get_by_account_id( prototype.account_id) for achievement_id in prototype.achievements.achievements_ids(): for item in storage.achievements_storage[ achievement_id].rewards: if not collection.has_item(item): GiveItemTaskPrototype.create(prototype.account_id, item.id)
def setUp(self): super(LogicTests, self).setUp() create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_1_items = AccountItemsPrototype.get_by_account_id( self.account_1.id) self.collection_1 = CollectionPrototype.create( caption='collection_1', description='description_1') self.collection_2 = CollectionPrototype.create( caption='collection_2', description='description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption='kit_1', description='description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption='kit_2', description='description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption='kit_3', description='description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption='item_1_1', text='text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption='item_1_2', text='text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption='item_2_1', text='text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption='item_2_2', text='text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption='item_3_1', text='text_3_1', approved=True)
def setUp(self): super(LogicTests, self).setUp() create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.collection_1 = CollectionPrototype.create(caption='collection_1', description='description_1') self.collection_2 = CollectionPrototype.create(caption='collection_2', description='description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption='kit_1', description='description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption='kit_2', description='description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption='kit_3', description='description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption='item_1_1', text='text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption='item_1_2', text='text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption='item_2_1', text='text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption='item_2_2', text='text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption='item_3_1', text='text_3_1', approved=True)
def setUp(self): super(LogicTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id(self.account_1.id) self.collection_1 = CollectionPrototype.create(caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create(caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.kit_3 = KitPrototype.create(collection=self.collection_2, caption=u'kit_3', description=u'description_3', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'text_1_1', approved=False) self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'text_2_1', approved=True) self.item_2_2 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_2', text=u'text_2_2', approved=False) self.item_3_1 = ItemPrototype.create(kit=self.kit_3, caption=u'item_3_1', text=u'text_3_1', approved=True)
def setUp(self): super(BaseRequestTests, self).setUp() create_test_map() result, account_id, bundle_id = register_user('test_user_1', '*****@*****.**', '111111') self.account_1 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_2', '*****@*****.**', '111111') self.account_2 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_3', '*****@*****.**', '111111') self.account_3 = AccountPrototype.get_by_id(account_id) result, account_id, bundle_id = register_user('test_user_4', '*****@*****.**', '111111') self.account_4 = AccountPrototype.get_by_id(account_id) self.account_1_items = AccountItemsPrototype.get_by_account_id( self.account_1.id) self.account_2_items = AccountItemsPrototype.get_by_account_id( self.account_2.id) self.account_3_items = AccountItemsPrototype.get_by_account_id( self.account_3.id) group_edit_kit = sync_group('edit kit', ['collections.edit_kit']) group_edit = sync_group('edit collection', ['collections.edit_collection']) group_edit_item = sync_group('edit item', ['collections.edit_item']) group_moderate = sync_group('moderate collection', ['collections.moderate_collection']) group_moderate_kit = sync_group('moderate kit', ['collections.moderate_kit']) group_moderate_item = sync_group('moderate item', ['collections.moderate_item']) group_edit_kit.user_set.add(self.account_2._model) group_edit.user_set.add(self.account_2._model) group_edit_item.user_set.add(self.account_2._model) group_moderate.user_set.add(self.account_3._model) group_moderate_kit.user_set.add(self.account_3._model) group_moderate_item.user_set.add(self.account_3._model) self.collection_1 = CollectionPrototype.create( caption=u'collection_1', description=u'description_1') self.collection_2 = CollectionPrototype.create( caption=u'collection_2', description=u'description_2', approved=True) self.kit_1 = KitPrototype.create(collection=self.collection_1, caption=u'kit_1', description=u'description_1') self.kit_2 = KitPrototype.create(collection=self.collection_2, caption=u'kit_2', description=u'description_2', approved=True) self.item_1_1 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_1', text=u'item_text_1_1') self.item_1_2 = ItemPrototype.create(kit=self.kit_1, caption=u'item_1_2', text=u'item_text_1_2', approved=True) self.item_2_1 = ItemPrototype.create(kit=self.kit_2, caption=u'item_2_1', text=u'item_text_2_1', approved=True)
def add_item(self, item, account_id, notify): account_items = AccountItemsPrototype.get_by_account_id(account_id) account_items.add_item(item, notify=notify) account_items.save()
def get_account_info(account, hero): from the_tale.game.ratings import prototypes as ratings_prototypes from the_tale.game.ratings import relations as ratings_relations from the_tale.game.places import storage as places_storage from the_tale.game.places import logic as places_logic ratings = {} rating_places = ratings_prototypes.RatingPlacesPrototype.get_by_account_id( account.id) rating_values = ratings_prototypes.RatingValuesPrototype.get_by_account_id( account.id) if rating_values and rating_places: for rating in ratings_relations.RATING_TYPE.records: ratings[rating.value] = { 'name': rating.text, 'place': getattr(rating_places, '%s_place' % rating.field, None), 'value': getattr(rating_values, rating.field, None) } popularity = places_logic.get_hero_popularity(hero.id) places_history = [{ 'place': { 'id': place_id, 'name': places_storage.places[place_id].name }, 'count': help_count } for place_id, help_count in popularity.places_rating()] clan_info = None if account.clan_id: clan = account.clan clan_info = {'id': clan.id, 'abbr': clan.abbr, 'name': clan.name} return { 'id': account.id, 'registered': not account.is_fast, 'name': account.nick_verbose, 'hero_id': hero.id, 'places_history': places_history, 'might': account.might, 'achievements': AccountAchievementsPrototype.get_by_account_id(account.id).points, 'collections': AccountItemsPrototype.get_by_account_id(account.id).get_items_count(), 'referrals': account.referrals_number, 'ratings': ratings, 'permissions': { 'can_affect_game': account.can_affect_game }, 'description': account.description_html, 'clan': clan_info }
def add_item(self, item, account_id, notify): account_items = AccountItemsPrototype.get_by_account_id(account_id) account_items.add_item(item, notify=notify) account_items.save()