[GeoNode-users] Upload documents in bulk

Paolo Corti pcorti at gmail.com
Sun Oct 11 23:40:49 PDT 2015


Do something like this (not tested):

from geonode.documents.models import Document

doc_list = [
    {'title': 'title0', 'doc_file': '/path/to/file/0'},
    {'title': 'title1', 'doc_file': '/path/to/file/1'},
    {'title': 'title2', 'doc_file': '/path/to/file/2'},
]

owner = Profile.objects.all()[0] # change according to your needs

for doc in doc_list:
    doc = Document(
        title = doc['title'],
        doc_file = doc['doc_file'],
        owner = owner
    )
    doc.save()

hope it helps
p

On Tue, Oct 6, 2015 at 3:12 PM, Nic Tait <ngtait at gmail.com> wrote:
> Hi all,
>
> Would like to be able to use Geonode as a map catalog for a large number of
> pdf / png files but not sure of the best way to do this in bulk?  Cannot see
> anything in the documentation to do this so wondering if I need to create a
> python script using the django models - has anyone done anything similar ?
>
> Thanks,
> Nic
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>



-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the geonode-users mailing list