~ubuntu-branches/ubuntu/trusty/horizon/trusty-updates

« back to all changes in this revision

Viewing changes to horizon/forms/views.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-12-05 14:39:15 UTC
  • mfrom: (1.1.35)
  • Revision ID: package-import@ubuntu.com-20131205143915-40991ba69inywk0u
Tags: 1:2014.1~b1-0ubuntu1
* New upstream release.
* debian/control: open icehouse release.
* debian/static/openstack-dashboard: Refreshed static assets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
 
51
51
class ModalFormView(ModalFormMixin, generic.FormView):
52
 
    """
53
 
    The main view class from which all views which handle forms in Horizon
 
52
    """The main view class from which all views which handle forms in Horizon
54
53
    should inherit. It takes care of all details with processing
55
54
    :class:`~horizon.forms.base.SelfHandlingForm` classes, and modal concerns
56
55
    when the associated template inherits from
65
64
    """
66
65
 
67
66
    def get_object_id(self, obj):
68
 
        """
69
 
        For dynamic insertion of resources created in modals, this method
 
67
        """For dynamic insertion of resources created in modals, this method
70
68
        returns the id of the created object. Defaults to returning the ``id``
71
69
        attribute.
72
70
        """
73
71
        return obj.id
74
72
 
75
73
    def get_object_display(self, obj):
76
 
        """
77
 
        For dynamic insertion of resources created in modals, this method
 
74
        """For dynamic insertion of resources created in modals, this method
78
75
        returns the display name of the created object. Defaults to returning
79
76
        the ``name`` attribute.
80
77
        """
81
78
        return obj.name
82
79
 
83
80
    def get_form(self, form_class):
84
 
        """
85
 
        Returns an instance of the form to be used in this view.
86
 
        """
 
81
        """Returns an instance of the form to be used in this view."""
87
82
        return form_class(self.request, **self.get_form_kwargs())
88
83
 
89
84
    def form_valid(self, form):