<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Simone,<div class=""><br class=""></div><div class="">thanks for your fast reply! Would you kindly check if I understood your advise correctly and picked the right places?</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="">You have to define your own url, views etc. </div></div></blockquote></div><div class=""><br class=""></div><div class="">The metadata page is managed in first instance of layers app. </div><div class=""><ul class="MailOutline"><li class="">layers/urls.py points to layers/views.py </li><li class="">layers/views.py uses layers/models.py </li><li class="">layers/model.py inherits from <b class="">base</b>/models.py</li></ul></div><div class=""><br class=""></div><div class="">This means it could work like this:</div><div class=""><br class=""></div><div class=""><ol class="MailOutline"><li class="">copy apps: <b class="">/base</b> and <b class="">/layers</b> to <b class="">/var/www/my_project</b></li><li class="">Routing views: change <b class=""> <b class="">my_project/</b>layers/urls.py</b> to use <b class="">my_project/layers/views.py</b></li><ol class=""><li class=""> <a href="https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/urls.py#L30" class="">https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/urls.py#L30</a> </li></ol><li class="">models: change <b class=""><b class="">my_project</b>/layers/views.py</b> to use <b class="">my_project/layers/models.py</b></li><ol class=""><li class=""><a href="https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/views.py#L47" class="">https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/views.py#L47</a></li></ol><li class="">change <b class="">my_project/models.py</b> to use <b class="">my_project/base/models.py</b></li><ol class=""><li class=""><a href="https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/models.py#L33" class="">https://github.com/GeoNode/geonode/blob/2.4.x/geonode/layers/models.py#L33</a></li></ol></ol></div><div class=""><br class=""></div><div class="">Correct?</div><div class=""><br class=""></div><div class=""><div class="">Thanks a lot,</div><div class=""><br class=""></div><div class="">Toni</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Am 02.02.2017 um 10:53 schrieb Simone Dalmasso <<a href="mailto:simone.dalmasso@gmail.com" class="">simone.dalmasso@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi, the way to use your own models instead of the default ones is quite tricky.<div class=""><br class=""></div><div class="">You have to define your own url, views etc. This is one of the cases where a fork could be an option to consider.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2017-02-02 10:26 GMT+01:00 Toni Schönbuchner <span dir="ltr" class=""><<a href="mailto:toni.schoenbuchner@csgis.de" target="_blank" class="">toni.schoenbuchner@csgis.de</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear List,<br class="">
<br class="">
on Geonode 2.4 (Ubuntu 14.04) I´d like to extend the metadata details page (route /metadata).<br class="">
This works perfectly by extending the base model which lives under:<br class="">
<br class="">
/usr/local/lib/python2.7/dist-<wbr class="">packages/geonode/base/models.<wbr class="">py<br class="">
<br class="">
To not hack the core we created a new project under /var/www/my_project<br class="">
and copied the base app there (/var/www/my_project/base).<br class="">
<br class="">
Template overrides work as expected but unfortunately it seems project models are ignored<br class="">
(and still the core model is utilized).<br class="">
<br class="">
What is the recommended way to customize models without changing the core?<br class="">
<br class="">
Thanks,<br class="">
<br class="">
Toni<br class="">
______________________________<wbr class="">_________________<br class="">
geonode-users mailing list<br class="">
<a href="mailto:geonode-users@lists.osgeo.org" class="">geonode-users@lists.osgeo.org</a><br class="">
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank" class="">https://lists.osgeo.org/<wbr class="">mailman/listinfo/geonode-users</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Simone </div>
</div>
</div></blockquote></div><br class=""></div></body></html>