[wingide-users] Django Template Browser
jason_decwest at yahoo.com
Fri Feb 21 13:37:36 EST 2014
So the logic is that the TEMPLATES DIR will shadow the installed apps templates (of the same path), i.e. the logic is as follows
pseudo code imagined for django - is this the way it works?
INSTALLED_APPS_Roots = [ ... ]
TEMPLATE_DIRs = (I think this is a list and not one ; right ?) [ ... ]
# if found in TEMPLATE_DIRs, return it.
# if found in INSTALLED_APPS_Roots return it
then something like template = locate_template_to_use('helloworld.html')
is how django does things and it "finds" one
On Friday, February 21, 2014 8:13 AM, Wingware Support <support at wingware.com> wrote:
Adi Sieker wrote:
> nearly all of the Python work I do is Django work and I've recently,
> had an idea that would help me tremendously when working with Django
> and that is a Django Template Browser.
> What it would do is display all available templates from the list of
> INSTALLED_APPS as a tree. It would then check which templates have
> been redefined in the TEMPLATE_DIRS directory. Each template getting
> an indicator if it was redefined or not. Templates that are in the
> TEMPLATE_DIRS but not in the INSTALLED_APPS would also be added to the
> tree. Right clicking on a template would display a pop up that either
> allows me to redefine the template or delete the redefinition. If I
> redefine the template Wing should read the contents of the template in
> the apps location and create a new template with the content of the
> original template in my TEMPLATE_DIRS directory and matching the path
> of the original template.
> In the below mockup, which is not complete, the templates with [-] are
> not redefined and the ones with [+] are redefined.
> Double clicking on a template would open the redefined template if it
> exists otherwise the original template and right clicking on a
> redefined template would give me the option to open the original template.
> I have no idea if this is feasible as an extension or not, but I would
> love to see something like that in Wing.
Based on my own experience w/ Django templates this sounds like a very
useful feature. I think it would be quite possible to implement it as
an extension script if someone wants to try it, based on
scripts.pylintpanel.py in the Wing installation for creating the new tool.
Or, a few scripts might be added to scripts/django.py that just add menu
items to the Project's context menu (using kContextProject GUI Context
described in http://wingware.com/doc/scripting/syntax ). That would
work slightly differently than what you describe above but could still
provide the same overall functionality in the context of the Project tool.
I'll add this to our list but of course it'll be prioritized w/
everything else so we probably won't work on it in the immediate future.
Wingware | Python IDE
The Intelligent Development Environment for Python Programmers
Wing IDE users list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wingide-users