Code

Changes between Version 2 and Version 3 of HydroAdmin


Ignore:
Timestamp:
12/15/12 07:37:46 (16 months ago)
Author:
tswicegood
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HydroAdmin

    v2 v3  
    1 Admin revamp project. Basically what the admin lakes is hooks to extend it as needed and in unexpected fashion, while it's always possible to extend it, current methods are considered hacks and introduce code that is not easy to maintain.  
     1Admin revamp project. 
     2 
     3''Planning to remove this editorial content'' 
     4> Basically what the admin lacks is hooks to extend it as needed and in unexpected fashion, while it's always possible to extend it, current methods are considered hacks and introduce code that is not easy to maintain.  
    25 
    36What we propose here is a revamp of the the admin app looking for minimal work to customize the admin, striving for reusability and maintenability while still making it possible to: 
    47- extend every pages of the admin in an arbitrary fashion without having to rely on Javascript hacks  
    58- make it possible to add views easily 
    6 - Refresh the design and make it responsive (if it's not already) 
     9- Refresh the design and make it responsive 
    710 
    811 
     
    1821 
    1922- Current workflow for most page is to customize the pages of the admins are the following: 
    20  - most commong way: Override ModelAdmin or Admin class methods, inject needed variables in template context and then override the templates: this can be made simpler, overriding templates is not considered future proof and can be made simpler 
     23 - most common way: Override ModelAdmin or Admin class methods, inject needed variables in template context and then override the templates: this can be made simpler, overriding templates is not considered future proof and can be made simpler 
    2124 - There are hooks to insert custom code (filter spec, admin actions) but it's predefined, not flexible and bound to features already defined in the admin. What if one wants a custom sidebar that fills the form dynamically from generated list of templates ? 
    22  - Insert Javascript, this is the most flexible way to extend the admin, it's hacky, javascript and might not be accessible. 
     25 - Insert Javascript, this is the most flexible way to extend the admin, it's hacky and promotes creation of code that might not be accessible. 
    2326 - Adding a view is two way process a) subclass get_urls, add the url b) create a new method of ModelAdmin as view 
    2427 
     
    3336 - Same features as current admin 
    3437 - Responsive 
    35  - One class per admin page 
     38 - Use class-based-views throughout 
     39 
     40 
     41=== Features that need further definition === 
    3642 - Each page is a widget composition 
    3743 - Each widget is class 
    3844 
     45== Examples of Admin Extension in the Wild == 
     46In alphabetical order: 
     47 
     48* django-admin-tools (http://pypi.python.org/pypi/django-admin-tools/0.4.1) 
     49* Grappelli (http://www.grappelliproject.com/) 
     50* … 
     51 
     52Built on top of admin-tools: 
     53* django-admintools-bootstrap (https://bitbucket.org/salvator/django-admintools-bootstrap) 
     54* pops (https://github.com/tswicegood/pops -- fork/near rewrite of above) 
     55* … 
     56 
     57Simple Bootstrap Themes: 
     58* https://github.com/michaelhelmick/django-bootstrap-admin 
     59* https://github.com/gkuhn1/django-admin-templates-twitter-bootstrap 
     60* https://github.com/riccardo-forina/django-admin-bootstrapped 
     61* https://github.com/aobo711/bootstrap-django-admin 
     62* … 
    3963 
    4064== Pros == 
     
    134158== Comments == 
    135159 
     160 
     161- Instead of proposing a specific solution, let's focus on identifying the issues that the current admin has without the editorial content.  For example "no more monkey patching" as a pro without an actual example of functionality that can not be done without monkey patching the admin is baseless. ''–Travis Swicegood'' 
     162 
    136163- Is it OK to allow both a string and a list of strings as argument/attributes, like it's done for templates ? that way the above examples can be made simpler by dropping some brackets, it's bit more documentation but when you have to do lot of those it makes things easier I think. 
    137164- ...