[GeoNode-devel] template inheritance

Francesco Bartoli xbartolone at gmail.com
Thu Oct 20 02:32:24 PDT 2016


Hi devs,

I found that circular inheritance from a geonode-project perspective is not well managed yet. Just to explain better the issue:

[geonode]
geonode/base/templates/base/resourcebase_info_panel.html

{% block morecontent %}

<some content>

{% endblock %}

[my_geonode_project]
my_geonode_project/templates/base/resourcebase_info_panel.html

{% extends "base/resourcebase_info_panel.html" %}

{% block morecontent %}

{{ block.super }}
<div>hello geonode developers</div>

{% endblock %}

This configuration ends up in such an error:

"RuntimeError: maximum recursion depth exceeded while calling a Python object”

I have tried to adopt this approach [1] but doesn’t resolve in my case, the only way is to follow the alternative one with django-overextends. Long story short I’d like to add this latter to geonode-project as dependency and a bit of documentation how to use it for extending core templates.

Any objections?

Thanks,
Francesco

[1] https://code.djangoproject.com/wiki/ExtendingTemplates#Extendingtemplates

Il giorno 20/ott/2016, alle ore 10:05, Francesco Bartoli <xbartolone at gmail.com> ha scritto:

> Thanks Simone. I’m going to move this discussion to the dev list because at the moment the circular inheritance wouldn’t work well from geonode-project, at least from what I investigated so far.
> 
> Francesco
>  
> Il giorno 20/ott/2016, alle ore 07:23, Simone Dalmasso <simone.dalmasso at gmail.com> ha scritto:
> 
>> Francesco, I don't see that harmful. Please go on.
>> 
>> 2016-10-19 9:03 GMT+02:00 Francesco Bartoli <xbartolone at gmail.com>:
>> Hi all,
>> 
>> I'd like to add 'block' syntax to the template of the info panel in the core resourcebase_info_panel.html in order to extend it with additional information. Do you think this can be useful to merge in the core as at the moment I don't know how a sane approach would be from a django-project?
>> 
>> Any different idea?
>> 
>> Thanks,
>> Francesco
>> 
>> Sent from Nylas N1, the extensible, open source mail client.
>> _______________________________________________
>> geonode-users mailing list
>> geonode-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geonode-users
>> 
>> 
>> 
>> 
>> -- 
>> Simone 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20161020/ce990605/attachment.html>


More information about the geonode-devel mailing list