Ejemplo n.º 1
0
def a_mgrApplication_03_VIEW_subscribetoggle(request, object_id):
    instance = a_mgrApplication_03.objects.get(pk=object_id)
    QS = subscription_01.objects.filter(application=instance, auto_citizen__exact=request.META['duo_citizen'])

    if QS.count():
        QS[0].delete()
    else:
        newSubscription = subscription_01()
        newSubscription.application = instance
        newSubscription.save(request=request)
    
    return a_mgrApplication_03.redirectView(request, 'a_mgrApplication_03_VIEW_List', 'admFormPr')
Ejemplo n.º 2
0
def a_mgrApplication_03_newCitizenDefaultSubscriptions(request):
    apps = a_mgrApplication_03.objects.all()
    for app in apps:
        newSubscription = subscription_01()
        newSubscription.application = app
        newSubscription.save(request=request)