def insert_acc(self, post_data): self.form = AccountModelForm(post_data) if self.form.is_valid(): self.form.instance.entry_manual_added = True self.form.save() return True return False
def insert_acc(self, post_data): self.form = AccountModelForm(post_data) if self.form.is_valid(): self.form.instance.entry_manual_added = True self.form.save() return True return False
class AccountSettings(object): def __init__(self): self.acc_objects_all = Account.objects.filter(entry_manual_added=True) self.form = AccountModelForm() self.form_submitted = False def init_form(self): return {'acc_form': self.form, 'acc_objects_all': self.acc_objects_all} def insert_acc(self, post_data): self.form = AccountModelForm(post_data) if self.form.is_valid(): self.form.instance.entry_manual_added = True self.form.save() return True return False def delete_acc(self, get_data): self.obj = Account.objects.filter(pk=get_data) self.obj.delete()
class AccountSettings(object): def __init__(self): self.acc_objects_all = Account.objects.filter(entry_manual_added=True) self.form = AccountModelForm() self.form_submitted = False def init_form(self): return {'acc_form': self.form, 'acc_objects_all': self.acc_objects_all} def insert_acc(self, post_data): self.form = AccountModelForm(post_data) if self.form.is_valid(): self.form.instance.entry_manual_added = True self.form.save() return True return False def delete_acc(self, get_data): self.obj = Account.objects.filter(pk=get_data) self.obj.delete()
def __init__(self): self.acc_objects_all = Account.objects.filter(entry_manual_added=True) self.form = AccountModelForm() self.form_submitted = False
def __init__(self): self.acc_objects_all = Account.objects.filter(entry_manual_added=True) self.form = AccountModelForm() self.form_submitted = False