How to use the dispatch.apps.manager.forms.PersonForm function in dispatch

To help you get started, we’ve selected a few dispatch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ubyssey / dispatch / dispatch / apps / manager / views.py View on Github external
def user_edit(request, id):

    p = Person.objects.get(pk=id)

    if request.method == 'POST':
        form = PersonForm(request.POST, request.FILES, instance=p)
        if form.is_valid():
            form.save()
            return redirect(users)
    else:
        form = PersonForm(instance=p)

    context = {
        'title': 'Edit User',
        'person': p,
        'form': form,
        'user_form': form.user_form,
    }

    return render(request, "manager/person/edit.html", context)
github ubyssey / dispatch / dispatch / apps / manager / views.py View on Github external
def user_edit(request, id):

    p = Person.objects.get(pk=id)

    if request.method == 'POST':
        form = PersonForm(request.POST, request.FILES, instance=p)
        if form.is_valid():
            form.save()
            return redirect(users)
    else:
        form = PersonForm(instance=p)

    context = {
        'title': 'Edit User',
        'person': p,
        'form': form,
        'user_form': form.user_form,
    }

    return render(request, "manager/person/edit.html", context)
github ubyssey / dispatch / dispatch / apps / manager / forms.py View on Github external
def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)

        args = []
        kwargs = {}

        if self.data and self.instance.person:
            self.person_form = PersonForm(self.data, user_form=False, instance=self.instance.person)
        elif self.instance.person:
            self.person_form = PersonForm(user_form=False, instance=self.instance.person)
        elif self.data:
            self.person_form = PersonForm(self.data, user_form=False)
        else:
            self.person_form = PersonForm(user_form=False)
github ubyssey / dispatch / dispatch / apps / manager / forms.py View on Github external
def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)

        args = []
        kwargs = {}

        if self.data and self.instance.person:
            self.person_form = PersonForm(self.data, user_form=False, instance=self.instance.person)
        elif self.instance.person:
            self.person_form = PersonForm(user_form=False, instance=self.instance.person)
        elif self.data:
            self.person_form = PersonForm(self.data, user_form=False)
        else:
            self.person_form = PersonForm(user_form=False)
github ubyssey / dispatch / dispatch / apps / manager / forms.py View on Github external
def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)

        args = []
        kwargs = {}

        if self.data and self.instance.person:
            self.person_form = PersonForm(self.data, user_form=False, instance=self.instance.person)
        elif self.instance.person:
            self.person_form = PersonForm(user_form=False, instance=self.instance.person)
        elif self.data:
            self.person_form = PersonForm(self.data, user_form=False)
        else:
            self.person_form = PersonForm(user_form=False)
github ubyssey / dispatch / dispatch / apps / manager / forms.py View on Github external
def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)

        args = []
        kwargs = {}

        if self.data and self.instance.person:
            self.person_form = PersonForm(self.data, user_form=False, instance=self.instance.person)
        elif self.instance.person:
            self.person_form = PersonForm(user_form=False, instance=self.instance.person)
        elif self.data:
            self.person_form = PersonForm(self.data, user_form=False)
        else:
            self.person_form = PersonForm(user_form=False)
github ubyssey / dispatch / dispatch / apps / manager / forms.py View on Github external
def is_valid(self):
        if self.user_form:
            return super(PersonForm, self).is_valid() and self.user_form.is_valid()
        else:
            return super(PersonForm, self).is_valid()
github ubyssey / dispatch / dispatch / apps / manager / views.py View on Github external
def user_add(request):

    if request.method == 'POST':
        form = PersonForm(request.POST, request.FILES, user_form=False)
        if form.is_valid():
            form.save()
            return redirect(users)
    else:
        form = PersonForm(user_form=False)

    context = {
        'title': 'Add User',
        'form': form,
        'user_form': form.user_form,
    }

    return render(request, "manager/person/edit.html", context)