Thanks Nyall,

FYI I created an issue, in case some django/html/js guru comes up with a better 
idea: https://github.com/qgis/QGIS-Django/issues/289

Richard

On 6/29/23 01:00, Nyall Dawson wrote:
On Mon, 26 Jun 2023 at 14:01, Richard Duivenvoorde <rdmaili...@duif.net> wrote:

On 6/26/23 00:55, Nyall Dawson wrote:
Thanks Richard, I've found this setting now! (For other's reference it's under "Manage" - 
"Edit" - "Owners").

It's a bit clunky unfortunately -- there's a list box with over 4000 entries 
and I need to safely select multiple entries from this 😂...  I think I'll 
resort to some js console trickery to make sure I do it correctly!

Yeah, you are right... it's was OK in the beginning of our plugins... or if you 
want to select just one, but in your case..

This is the repo of the site: https://github.com/qgis/QGIS-Django/

Feel free to add a Feature Request to easier filter or multi select that list.

In case it's useful for anyone else, here's the little script I used
to easily set a bunch of owners:

owners_input = document.getElementById('id_owners')
const users = ["some_user", "another_user", "another_person"];
for (var i = 0; i < owners_input.options.length; i++) {
     if ( users.includes(owners_input.options[i].text))
     {
       console.log(owners_input.options[i].text);
       owners_input.options[i].selected = true;
     }
     else
     {
       owners_input.options[i].selected = false;
     }
}

Nyall




Regards,

Richard

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to