django_sorcery.views.edit module

Django edit view things for sqlalchemy.

class django_sorcery.views.edit.BaseCreateView(**kwargs)[source]

Bases: django_sorcery.views.edit.ModelFormMixin, django_sorcery.views.edit.ProcessFormView

Base view for creating a new object instance.

Using this base class requires subclassing to provide a response mixin.

get(request, *args, **kwargs)[source]

Handle GET requests: instantiate a blank version of the form.

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

class django_sorcery.views.edit.BaseDeleteView(**kwargs)[source]

Bases: django_sorcery.views.edit.DeletionMixin, django_sorcery.views.detail.BaseDetailView

Base view for deleting an object.

Using this base class requires subclassing to provide a response mixin.

class django_sorcery.views.edit.BaseFormView(**kwargs)[source]

Bases: django.views.generic.edit.FormMixin, django_sorcery.views.edit.ProcessFormView

A base view for displaying a form.

class django_sorcery.views.edit.BaseUpdateView(**kwargs)[source]

Bases: django_sorcery.views.edit.ModelFormMixin, django_sorcery.views.edit.ProcessFormView

Base view for updating an existing object.

Using this base class requires subclassing to provide a response mixin.

get(request, *args, **kwargs)[source]

Handle GET requests: instantiate a blank version of the form.

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

class django_sorcery.views.edit.CreateView(**kwargs)[source]

Bases: django_sorcery.views.detail.SingleObjectTemplateResponseMixin, django_sorcery.views.edit.BaseCreateView

View for creating a new object, with a response rendered by a template.

template_name_suffix = '_form'
class django_sorcery.views.edit.DeleteView(**kwargs)[source]

Bases: django_sorcery.views.detail.SingleObjectTemplateResponseMixin, django_sorcery.views.edit.BaseDeleteView

View for deleting an object retrieved with self.get_object(), with a response rendered by a template.

template_name_suffix = '_confirm_delete'
class django_sorcery.views.edit.DeletionMixin[source]

Bases: object

Provide the ability to delete objects.

delete(request, *args, **kwargs)[source]

Call the delete() method on the fetched object and then redirect to the success URL.

get_success_url()[source]

Returns the URL to redirect to after processing deletion.

post(request, *args, **kwargs)[source]

Handle POST request on deleve view.

success_url = None
class django_sorcery.views.edit.FormView(**kwargs)[source]

Bases: django.views.generic.base.TemplateResponseMixin, django_sorcery.views.edit.BaseFormView

A view for displaying a form and rendering a template response.

class django_sorcery.views.edit.ModelFormMixin[source]

Bases: django.views.generic.edit.FormMixin, django_sorcery.views.detail.SingleObjectMixin

Provide a way to show and handle a ModelForm in a request.

fields = None
form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_form_class()[source]

Return the form class to use.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

class django_sorcery.views.edit.ProcessFormView(**kwargs)[source]

Bases: django.views.generic.base.View

Render a form on GET and processes it on POST.

get(request, *args, **kwargs)[source]

Handle GET requests: instantiate a blank version of the form.

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

put(request, *args, **kwargs)

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

class django_sorcery.views.edit.UpdateView(**kwargs)[source]

Bases: django_sorcery.views.detail.SingleObjectTemplateResponseMixin, django_sorcery.views.edit.BaseUpdateView

View for updating an object, with a response rendered by a template.

template_name_suffix = '_form'