Metadata-Version: 1.1
Name: django-admin-model-action
Version: 0.1.1
Summary: adds the hability to have action buttons on the admin chage view
Home-page: http://github.com/arthur-debert/django-admin-model-action
Author: Arthur Debert
Author-email: arthur@stimuli.com.br
License: UNKNOWN
Description-Content-Type: UNKNOWN
Description: Getting Started
        ===============
        
        To get started using ``django-admin-model-action`` simply install it with
        ``pip``::
        
            $ pip install django-admin-model-action
        
        Quick start::
        - Add adminmodelaction to your ``INSTALLED_APPS``.
        - On your model admin, inherit from ```ActionAdmin```.
        - Specify the action method to run (as a string pointing to a model's method, or a regular method). Example::
        
            from adminmodelaction.admin import ActionAdmin
        
            class EntryAdmin(ActionAdmin):
                model_actions = ['publish']
                model = Entry
        
        And then on your Article model::
        
            class Article(models.Model):
                #... definitions go here ...
                
                def can_publish_article(self, request):
                    # this is optional: it's a hook that allows you not to display
                    # this action for a given model.
                    # in this example, we only allow publishing of non public articles
                    # in order not to notify author twice
                    return !self.public
                    
                def publish(self, request):
                    self.public=True
                    notify_author(self.author, self.title)
                    # the admin message will be return result from this method
                    return "Your entry %s was published." % (self.title).
                publish.short_description = 'Publish Article'    
                publish.can_add_action = can_publish_article
                    
        This will create a "Publish Article" button on top of each article's change view on the admin.
        Once an admin clicks on it, the 'publish' method will be called on the Article's instance. In this case, for example
        publishing an article will change it's ```public``` property, and also notify the author.
        
        By using the optional ```action_method.can_add_action``` we make sure the action will only appear to models not published already.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Framework :: Django
