Hi Maxime,
Here are the two main files doing the job (geoloader creates the model,
geotools is just a set of useful functions). It doesn't rely on
inspectdb, but on ogr.
Don't hesitate to aks any question you wish.
Best regards
Guillaume
Le 12/04/13 14:49, Max Demars a ᅵcrit :
> Hi Guillaume,
>
> I would be really interested to have a look at such code. I am not sure,
> but you seem to be describing something that may be similar to the
> django inspectdb function that auto-generates models from a legacy db (
>
https://docs.djangoproject.com/en/dev/howto/legacy-databases/#auto-generate-the-models
> ). What happens if more than a user update the models.py in the same
> time? Is it possible to use queue like celery to do the update one at a
> time?
>
> Thank you!
>
> Maxime
>
>
>
> On Thu, Apr 11, 2013 at 5:34 PM, Guillaume Sueur
> <
no-r...@neogeo-online.net <mailto:
no-r...@neogeo-online.net>> wrote:
>
> Hi Max,
>
> I've done something similar a few years ago. It was working rather
> OK with most shapefile, but was sometimes breaking on specific ones.
> As I used mod_python at this time, it was difficult to see the new
> model appear into the admin site without restarting apache. Maybe it
> can go better with wsgi now. Didn't try.
>
> The purpose was to use layers introspection to generate the model
> description, and then write it in the models.py file... Not to be
> used by too many people at once ;-)
>
> If you are interested in it, I can send you pieces of code.
>
> Best regards
>
> Guillaume
>
> Le 11/04/13 22:31, Max Demars a ᅵcrit :
>
> Hi Michael Savarese,
>
> Thanks for your quick reply. However, my problem is not how to
> load data
> in postgis, its more about how to make django ORM have access on
> those
> tables. I want my geodjango app to allow users to upload their own
> spatial tables on postgis and allow them to do spatial queries using
> geodjango queryset and database API.
>
>
> On Thu, Apr 11, 2013 at 3:29 PM, Michael Savarese
> <
geoma...@gmail.com <mailto:
geoma...@gmail.com>
> <mailto:
geoma...@gmail.com <mailto:
geoma...@gmail.com>>> wrote:
>
> As a quick alternative, you may want to look at QGIS and QGIS
> Server. There are plugins to upload shapefiles into a local or
> remote postgresql/postgis database. By the way, I'd be wary of
> letting users, qualified or not, freely uploading data to your
> database. Could get bloated, redundant, and messy.
>
>
> On Thu, Apr 11, 2013 at 3:21 PM, Max Demars
> <
burton...@gmail.com <mailto:
burton...@gmail.com>
> <mailto:
burton...@gmail.com
> geodjango+unsubscribe@__
googlegroups.com
> <mailto:
geodjango%2Bunsu...@googlegroups.com>
> <mailto:
geodjango%__2Buns...@googlegroups.com
> <mailto:
geodjango%252Buns...@googlegroups.com>__>.
>
> To post to this group, send email to
>
geod...@googlegroups.com <mailto:
geod...@googlegroups.com>
> <mailto:
geodjango@__
googlegroups.com
> <mailto:
geod...@googlegroups.com>>.
>
> Visit this group at
>
http://groups.google.com/__group/geodjango?hl=en
> <
http://groups.google.com/group/geodjango?hl=en>.
> For more options, visit
>
https://groups.google.com/__groups/opt_out
> <
https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to a
> topic in
> the Google Groups "geodjango" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/__topic/geodjango/JvOGQfdwHtY/__unsubscribe?hl=en
> <
https://groups.google.com/d/topic/geodjango/JvOGQfdwHtY/unsubscribe?hl=en>.
> To unsubscribe from this group and all its topics, send an
> email to
> geodjango+unsubscribe@__
googlegroups.com
> <mailto:
geodjango%2Bunsu...@googlegroups.com>
> <mailto:
geodjango%__2Buns...@googlegroups.com
> <mailto:
geodjango%252Buns...@googlegroups.com>__>.
>
> To post to this group, send email to
>
geod...@googlegroups.com <mailto:
geod...@googlegroups.com>
> <mailto:
geodjango@__
googlegroups.com
> <mailto:
geod...@googlegroups.com>>.
>
> Visit this group at
>
http://groups.google.com/__group/geodjango?hl=en
> <
http://groups.google.com/group/geodjango?hl=en>.
> For more options, visit
>
https://groups.google.com/__groups/opt_out
> <
https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "geodjango" group.
> To unsubscribe from this group and stop receiving emails from
> it, send
> an email to geodjango+unsubscribe@__
googlegroups.com
> <mailto:
geod...@googlegroups.com>.
> Visit this group at
>
http://groups.google.com/__group/geodjango?hl=en
> <
http://groups.google.com/group/geodjango?hl=en>.
> For more options, visit
>
https://groups.google.com/__groups/opt_out
> <
https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "geodjango" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/__topic/geodjango/JvOGQfdwHtY/__unsubscribe?hl=en
> <
https://groups.google.com/d/topic/geodjango/JvOGQfdwHtY/unsubscribe?hl=en>.
> To unsubscribe from this group and all its topics, send an email to
> geodjango+unsubscribe@__
googlegroups.com
> <mailto:
geod...@googlegroups.com>.
> Visit this group at
http://groups.google.com/__group/geodjango?hl=en
> <
http://groups.google.com/group/geodjango?hl=en>.
> For more options, visit
https://groups.google.com/__groups/opt_out
> <
https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "geodjango" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
geodjango+...@googlegroups.com.