Exemplo n.º 1
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'))
Exemplo n.º 2
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)