Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Internet > Django Plugins

    django-extra-views 0.6.1

    Download button

    No screenshots available
    Downloads: 170  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Andrew Ingram | More programs
    MIT/X Consortium Lic... / FREE
    July 20th, 2012, 23:03 GMT
    ROOT / Internet / Django Plugins

     Read user reviews (0)  Refer to a friend  Subscribe

    django-extra-views description

    Extra class-based views for Django

    Django's class-based generic views are great, they let you accomplish a large number of web application design patterns in relatively few lines of code. They do have their limits though, and that's what django-extra-views aims to overcome.

    Installation

    Installing from pypi (using pip).

    pip install django-extra-views

    Installing from github.

    pip install -e git://github.com/AndrewIngram/django-extra-views.git#egg=django-extra-views

    Features so far

    - FormSet and ModelFormSet views - The formset equivalents of FormView and ModelFormView.
    - InlineFormSetView - Lets you edit formsets related to a model (uses inlineformset_factory)
    - CreateWithInlinesView and UpdateWithInlinesView - Lets you edit a model and its relations
    - GenericInlineFormSetView, the equivalent of InlineFormSetView but for GenericForeignKeys
    - Support for generic inlines in CreateWithInlinesView and UpdateWithInlinesView

    Examples

    Defining a FormSetView.

    from extra_views import FormSetView

    class AddressFormSet(FormSetView):
     form_class = AddressForm
     template_name = 'address_formset.html'


    Defining a ModelFormSetView.

    from extra_views import ModelFormSetView:

    class ItemFormSetView(ModelFormSetView):
     model = Item
     template_name = 'item_formset.html'


    Defining a CreateWithInlinesView and an UpdateWithInlinesView.

    from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSet
    from extra_views.generic import GenericInlineFormSet

    class ItemInline(InlineFormSet):
     model = Item

    class TagInline(GenericInlineFormSet):
     model = Tag

    class CreateOrderView(CreateWithInlinesView):
     model = Order
     inlines = [ItemInline, TagInline]

    class UpdateOrderView(UpdateWithInlinesView):
     model = Order
     inlines = [ItemInline, TagInline]

    # Example URLs.
    urlpatterns = patterns('',
     url(r'^orders/new/$', CreateOrderView.as_view()),
     url(r'^orders/(?P\d+)/$', UpdateOrderView.as_view()),
    )


    More descriptive examples to come.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    class-based views | Django views | Django | class-based | views

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM