<div dir="ltr">Hi Chiara<div>sounds great, feel free to send a pull request with your changes.</div><div>Keep in mind that counting keywords instances could be time consuming and is not really scalable with the Django ORM, so maybe a settings to enable/disable countings would be also helpful</div><div>cheers</div><div>Paolo</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 9, 2019 at 5:11 AM Chiara Sammarco <<a href="mailto:chiara.sammarco@geodatalab.it">chiara.sammarco@geodatalab.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks for your reply, Paolo. <br>Since I didn't want the admin to be in charge of this, I've written some code for</div><div>fixing at least partially the bug by myself. <br>I'm in a rush for a deadline, but I would like to finish something in the code and then if it can be interesting for the others, I can share my code.<br><br>basically the
hkeyword (or something like that) function in the views was calling the wrong model. <br>Indeed there are two tables in the db: one containing the
hkeyword details and the other containing</div><div>the information "which resource is associated to which keyword" - the last one is the most interesting </div><div>for the inquiry. Because from there I could:</div><div><br></div><div>- get the count (how many times each keyword is contained in each resource of a specific type)<br>- if count = 0 I don't pass the keyword<br><br></div><div>I've also pass the resource type (in order to filter only the keyword associated to a particular type of resource - layer, map or document)<br><br>I've just to fix the view for showing the bullet (since I have not found this last step immediate, I left for a second moment).<br>but it is still much better now. In my case, I don't have structured keyword, all of my keywords are leaves in the tree of keywords, so </div><div>for making the code still more general, this case should be treated.<br><br>Thanks for your help and answer. <br>Have a nice day,</div><div>Chiara<br><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 5, 2019 at 3:52 AM Paolo Corti <<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Chiara<br>
you are correct. The old feature of taggit with the elements counting<br>
has been lost when the hkeyword app replace taggit app in GeoNode (I believe at<br>
2.4) and all of the keywords are now displayed even if there are not<br>
elements referring to.<br>
For one of the GeoNode instances I am in charge of - where the number<br>
of keywords was becoming really too large, I created a small app which<br>
let the GeoNode admin to select which keywords to show in the left<br>
side search menu.<br>
That is in a private git repo but if there is interest I can port it<br>
to GeoNode core. Though, no countings.<br>
Paolo<br>
<br>
On Wed, Dec 4, 2019 at 3:48 AM Chiara Sammarco<br>
<br>
<<a href="mailto:chiara.sammarco@geodatalab.it" target="_blank">chiara.sammarco@geodatalab.it</a>> wrote:<br>
><br>
><br>
><br>
> Hi again,<br>
> I just wanted to tell that I've found the new tables where the keywords are stored: base_hierarchicalkeyword and base_taggedcontentitem<br>
> Once I repopulated those tables, the keywords appeared in the list.<br>
><br>
> Now the problems are the following:<br>
> - the keywords are shown only with the folder icons (even id there are no children under them)<br>
> - the number of elements (layers or map) associated to a specific keyword is not shown<br>
> - in the list (both in Maps and in Layers) all the keywords are shown (also if there are no elements for that keyword).<br>
><br>
> Are these issues? Or am I supposed to do something else?<br>
> Thanks in advance for your help,<br>
> Chiara<br>
><br>
> On Mon, Dec 2, 2019 at 5:23 PM Chiara Sammarco <<a href="mailto:chiara.sammarco@geodatalab.it" target="_blank">chiara.sammarco@geodatalab.it</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> My environment: SPCGeonode 2.0, Ubuntu 18.04<br>
>><br>
>> Problem: geonode does not fetch from the database neither the keywords associated to the layers, nor those associated to the maps. So basically the following requests both return an empty array:<br>
>><br>
>> GET /h_keywords_api?type=layer<br>
>> GET /h_keywords_api?type=map<br>
>><br>
>> I've checked in the database and the keywords are presents in the taggit_tag and taggit_taggeditem tables.<br>
>> Do you have any suggestions what it could be and how I could fix this?<br>
>> Thanks in advance for your help,<br>
>><br>
>> Chiara<br>
>><br>
>><br>
>><br>
><br>
> _______________________________________________<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/mailman/listinfo/geonode-users</a><br>
<br>
<br>
<br>
--<br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net" rel="noreferrer" target="_blank">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti<br>
#drt3jc1<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="color:rgb(0,0,0);font-family:Roboto,sans-serif;font-size:10pt;font-weight:bold">Chiara Sammarco</span><br></div><div dir="ltr"><span style="margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:Roboto,sans-serif;font-size:9pt"><table cellspacing="0" cellpadding="0" border="0" style="color:rgb(136,136,136);font-family:Arial,Helvetica,sans-serif;font-size:small"><tbody><tr><td valign="top" style="padding:0px"><span style="margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:Roboto,sans-serif;font-size:9pt">Full Stack Developer</span><br></td></tr><tr><td valign="top" style="padding:7px 0px 4px"><a href="https://www.geodatalab.info/" style="color:rgb(17,85,204)" target="_blank"><img src="https://www.geodatalab.info/wp-content/uploads/2019/06/mainmenulogo100x449.jpg" alt="GeoDataLab" title="GeoDataLab" width="148" border="0"></a></td></tr><tr><td valign="top" style="padding:0px"><span style="color:rgb(0,0,0);font-family:Roboto,sans-serif;font-size:9pt">via Vanni Biringucci, 55/B<font size="1" color="#B9B9B9">|</font> Roma, RM 00156<br>tel (+39) 0647543579 <font size="1" color="#B9B9B9">|</font> mobile (+39) 3421960662<br></span></td></tr><tr><td valign="top" style="padding:5px 0px 0px"><span style="margin-top:0px;color:rgb(36,174,95);font-size:8pt;font-weight:bold;font-family:Roboto,sans-serif"><a href="https://www.geodatalab.info/" style="color:rgb(36,174,95)" target="_blank"><font color="#24AE5F">www.geodatalab.info</font></a> <font size="1" color="#24AE5F">|</font> <a href="mailto:management@geodatalab.it" style="color:rgb(36,174,95)" target="_blank"><font color="#24AE5F">management@geodatalab.it</font></a></span></td></tr><tr><td valign="top" style="padding:7px 0px 0px"><a href="https://linkedin.com/in/chiarasammarco/" style="font-family:Arial,Helvetica,sans-serif;color:rgb(36,174,95)" target="_blank"><img src="https://www.geodatalab.info/wp-content/uploads/2019/07/li_icon.png" border="0" width="28" alt="LinkedIn"></a><font color="#222222" face="Arial, Helvetica, sans-serif"> </font><a href="https://twitter.com/geodatalab" style="color:rgb(17,85,204)" target="_blank"><img src="https://www.geodatalab.info/wp-content/uploads/2019/07/tw_icon.png" alt="Twitter" width="28" border="0"></a> <a href="https://it-it.facebook.com/geodatalab/" style="color:rgb(17,85,204)" target="_blank"><img src="https://www.geodatalab.info/wp-content/uploads/2019/07/fb-icon.png" alt="Facebook" width="28" border="0"></a></td></tr><tr><td valign="top" style="padding:8px 0px 0px"><span style="color:rgb(138,138,138);font-family:Roboto,sans-serif;font-size:8pt"><b>Nota di riservatezza: </b>Questa email contiene informazioni private e/o confidenziali. Se hai ricevuto questo messaggio per errore sei pregato di eliminarlo e notificare il mittente. Grazie per la collaborazione.<br></span></td></tr></tbody></table></span></div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Paolo Corti<br>Geospatial software developer<br>web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>twitter: @capooti<br>skype: capooti<br>#drt3jc1</div>