def delete(request, gid): group = Group.objects.get(pk=gid) if request.POST: if 'delete' in request.POST: _delete(group) return redirect(request, '/group') return redirect(request, '/group/show/%d' % group.id) return direct_to_template(request, 'group/delete.html', { 'instance': group, })
def show_edit(request, mf): form = FinanceForm(instance=mf) if request.POST: if 'delete' in request.POST: mf.delete() return redirect(request, '/microfinance') if form.is_valid(): form.save() return redirect(request, '/microfinance/show/%d' % mf.id) return direct_to_template(request, 'microfinance/edit.html', {'form': form})
def delete(request, pid): person = People.objects.get(pk=pid) if request.POST: if 'delete' in request.POST: _delete(person) return redirect(request, '/people') return redirect(request, '/people/show/%d' % person.id) return direct_to_template(request, 'people/delete.html', { 'instance': person, 'product_count': len(Product.objects.filter(person=person).all()), })
def delete(request, pid): person = People.objects.get(pk=pid) if request.POST: if 'delete' in request.POST: _delete(person) return redirect(request, '/people') return redirect(request, '/people/show/%d' % person.id) return direct_to_template( request, 'people/delete.html', { 'instance': person, 'product_count': len(Product.objects.filter(person=person).all()), })
def show_edit(request, product): form = ProductForm(instance=product) if request.POST: if 'delete' in request.POST: product.delete() return redirect(request, '/product') if form.is_valid(): form.save() return redirect(request, '/product/show/%d' % product.id) return direct_to_template(request, 'product/edit.html', { 'form': form, })
def show(request, trx): form = TransactionForm(instance=trx) if request.POST: person_id = trx.person.id if 'delete' in request.POST: trx.delete() return redirect(request, '/people/show/%d?tab=transaction' % person_id) if form.is_valid(): form.save() return redirect(request, '/people/show/%d?tab=transaction' % person_id) return direct_to_template(request, 'transaction/edit.html', { 'form': form, })
def show(request, cl): form = ClusterForm(instance=cl) if request.POST: if form.is_valid(): form.save() return redirect(request) return direct_to_template(request, "cluster/edit.html", {"form": form})
def type_show_edit(request, type_): form = TypeForm(instance=type_) if request.POST: if form.is_valid(): form.save() return redirect(request, '/product/type/%d' % type_.id) return direct_to_template(request, 'product/type/edit.html', { 'form': form, })
def show_edit(request, person): form = PeopleForm(instance=person) if request.POST: if form.is_valid(): form.save() return redirect(request, '/people/show/%d' % person.id) return direct_to_template(request, 'people/edit.html', { 'form': form, })
def report_show(request, report): form = ReportForm(instance=report) if request.POST: if form.is_valid(): form.save() return redirect(request, destination(report.group.id, 'laporan')) return direct_to_template(request, 'group/report/edit.html', { 'form': form, })
def training_show_edit(request, training): form = TrainingForm(instance=training) if request.POST: if form.is_valid(): form.save() return redirect(request, destination(training.group.id, 'pelatihan')) return direct_to_template(request, 'group/training/edit.html', { 'form': form, })
def training_delete(request, tid): training = Training.objects.get(pk=tid) if request.POST: if 'delete' in request.POST: training.delete() return redirect(request, destination(training.group.id, 'pelatihan')) return direct_to_template(request, 'group/training/delete.html', { 'instance': training, })
def report_delete(request, rid): report = Report.objects.get(pk=rid) if request.POST: if 'delete' in request.POST: report.delete() return redirect(request, destination(report.group.id, 'laporan')) return direct_to_template(request, 'group/report/delete.html', { 'instance': report, })
def training_show(request, training): form = TrainingForm(instance=training) if request.POST: if form.is_valid(): form.save() return redirect(request, '/people/show/%d?tab=pelatihan' % training.person.id) return direct_to_template(request, 'people/training/edit.html', { 'form': form, })
def delete(request, cid): cluster = Cluster.objects.get(pk=cid) if request.POST: if "delete" in request.POST: _delete(cluster) return redirect(request, "/livecenter/show/%d?tab=cluster" % cluster.livecenter.id) return direct_to_template( request, "cluster/delete.html", {"instance": cluster, "groups": Group.objects.filter(cluster=cluster)} )
def training_show(request, training): form = TrainingForm(instance=training) if request.POST: if form.is_valid(): form.save() return redirect( request, '/people/show/%d?tab=pelatihan' % training.person.id) return direct_to_template(request, 'people/training/edit.html', { 'form': form, })
def show_edit(request, group): form = GroupForm(instance=group) if request.POST: if form.is_valid(): form.save() return redirect(request, '/group/show/%d' % group.id) return direct_to_template(request, 'group/edit.html', { 'form': form, 'customfields': Metaform.objects.filter(meta_type='group').\ filter(category__in=group.livecenter.category), })