<div dir="ltr">Hi,<div><br></div><div>The layers are actually saved in the layer_layer table but the relation is in document_document and points to the ContentType model. It is a generic relation since it can point to any other geonode resource. The two fields that you have to compile in the document table are the contenty_type (the id if the layer content type in your case) and object_id(the id of the target layer.)</div><div><br></div><div>Hope this helps</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-08 10:05 GMT+01:00 Eloi <span dir="ltr"><<a href="mailto:eloi@openmailbox.org" target="_blank">eloi@openmailbox.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good morning,<br>
<br>
I would like to establish the relation between a layer and a document using the GeoNode database and not using the web interface.<br>
I saw that the layers are listed in table 'base_resourcebase' and documents in 'documents_document'. So I wonder in which table the relation between the previous two is recorded. Then I would just run my SQL code to define does relations.<br>
<br>
Why I want to do this? Because every time I run the command "python manage.py updatelayers" all established relations (between a layers and a documents) disappear.<br>
<br>
Thank you in advance!<br>
<br>
Cheers,<br>
<br>
Eloi<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Eloi Ribeiro<br>
Geoinformatic<br>
51.9871, 5.6661<br>
<a href="http://eloiribeiro.eu" rel="noreferrer" target="_blank">http://eloiribeiro.eu</a><br>
______________________________<wbr>_________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/geonode-users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">SimoneĀ </div>
</div>