Beispiel #1
0
def to_equipment_detail_map(source):
    '''Equipment をマップに変換する
    '''
    
    obj = to_equipment_map(source)
    obj['upgrades'] = [to_upgrade_map(i) for i in UpgradeClass.get_by_equipment(source)]

    return obj
Beispiel #2
0
def delete_equipments(request):
    '''装備を全て削除する'''

    db.delete(EquipmentClass.all(keys_only=True))
    db.delete(UpgradeClass.all(keys_only=True))

    context = {}

    return HttpResponseRedirect(reverse('admin.views.index'))
Beispiel #3
0
 def _put_upgrade(self, item, equipment):
     '''解析した改造情報を保存する'''
     model = UpgradeClass.create_or_update(
         name = item['name'],
         effects = [unicode(e) for e in item['effects']],
         equipment = equipment,
         proficiency = item['proficiency'],
         ug_min = item['ug'][0],
         ug_max = item['ug'][1],
         cost = item['cost'])
     return model
Beispiel #4
0
def equipments(request):
    '''装備をすべて表示する'''

    equipments = []
    for i in EquipmentClass.all():
        equipments.append({
                'equipment': i,
                'upgrades': UpgradeClass.get_by_equipment(i)})
    context = {
        'items': equipments
        }
    return direct_to_template(request, 'equipments.html', context)