[GeoNode-users] How to establish a relation between a layer and a document in the GeoNode database

Simone Dalmasso simone.dalmasso at gmail.com
Wed Mar 8 02:50:38 PST 2017


Hi,

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.)

Hope this helps

2017-03-08 10:05 GMT+01:00 Eloi <eloi at openmailbox.org>:

> Good morning,
>
> I would like to establish the relation between a layer and a document
> using the GeoNode database and not using the web interface.
> 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.
>
> 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.
>
> Thank you in advance!
>
> Cheers,
>
> Eloi
>
> --
> Eloi Ribeiro
> Geoinformatic
> 51.9871, 5.6661
> http://eloiribeiro.eu
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>



-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170308/7df0cef6/attachment.html>


More information about the geonode-users mailing list