Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    dingo 0.2.2

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Nathan R. Yergler | More programs
    BSD License / FREE
    January 31st, 2011, 13:07 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    dingo description

    Django Admin Extender

    dingo is a Django app which extends the Django Admin to allow the easy creation of additional views for Model classes and instances. dingo also allows you to customize the Admin of third party applications, without subclassing or modifying the original source tree.

    Usage

    To use dingo, ensure that it's on the Python path, and add it to your INSTALLED_APPS setting in settings.py. Note that dingo must be installed before django.contrib.admin, as it replaces the default AdminSite with one which will instrument the ModelAdmin classes registered.

    Models vs. Objects

    dingo can be used to register views for Models or Objects. Views registered for Models are not specific to any instance of the model; they can be thought of as similar to Django admin actions with an [potentially] empty queryset. Instance views operate on single model instances; you can think of them as similar to admin actions that operate on a single object instead of a queryset.

    dingo views differ from admin actions in a couple of subtle ways. The most important difference is that they may be injected into third party applications wihthout sub-classing or modifying the application code. dingo views also have a different user interface by default. dingo includes replacement admin templates which show dingo views as buttons in the upper right hand area of the change list and change form views.

    Adding Views

    If you want to use dingo to add model or object views to your Model's admin, you can define them either as functions or as methods on the ModelAdmin.

    For example, to define the view as a function:

    import dingo
    import dingo_test.models

    @dingo.object_view(dingo_test.models.RstDocument)
    @dingo.short_description("Render")
    def render(model_admin, request, object_id):

     from django.shortcuts import redirect
     document = dingo_test.mdoels.RstDocument.objects.get(id=object_id)

     return Response()

    The same view may also be a method on the ModelAdmin:

    class RstDocumentAdmin(ModelAdmin):

     @dingo.object_view(dingo_test.models.RstDocument)
     @dingo.short_description("Render")
     def render(self, request, object_id):
     pass


    Note that the use of the short_description decorator defines the label used in the admin user interface, and is optional in this case. If no description is provided, dingo will format the function or method name, similar to how Django formats default verbose names for models.

    Adding Views to Third Party Applications

    So long as dingo is listed in INSTALLED_APPS before django.contrib.admin, the function-based example above will work as desired. Note that the code needs to be imported to ensure that registration occurs properly.


    Product's homepage

    Here are some key features of "dingo":

    · Easily create new views for your Model Admin, either at the Model or object level.
    · Inject customizations into the admin declaration of a third party application without modifying the original code base.

    Requirements:

    · Python

      


    TAGS:

    Django Admin | Model classes | Model instances | Django | admin | views

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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