Пример #1
0
def delete(request):
    p = CardDates(pk=request.REQUEST['id'])
    try:
        p.delete()
        data = '{"success":true}'
    except Exception, e1:
        data = '{"success":false, "msg": "%s"}' % (e1.args)
Пример #2
0
def update(request):
    req = request.REQUEST
    c = Card(pk=req['card.id'])
    p = CardDates(pk=req['id'],closeDate=DateService.invert(req['closeDate']),
                    expireDate=DateService.invert(req['expireDate']),
                    card=c)
    
    data = '{"success":true}'    
    try:
        p.save()
    except _mysql_exceptions.Warning:
        pass
    except Exception, e1:
        data = '{"success":false, "msg": "%s"}' % (e1.args)