#30649: Implement geometry validation in GIS database backend.
-----------------------------+--------------------------------------
Reporter: milosu | Owner: nobody
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Comment (by Simon Charette):
The `MakeValid` function also supports `Geometry` objects so you could
theoretically do
{{{#!python
valid_geometry = AModel.objects.annotate(
valid_geometry=MakeValid(invalid_geometry),
).values_list('valid_geometry', flat=True).first()
}}}
But that assumes `AModel` has at least one row.
The ORM doesn't support `SELECT` from no tables by it's table <-> model
class mapping nature.
If we wanted to add a way to do that it we should do it for all non-column
referencing expressions and not only for `MakeValid`.
e.g.
- `Expression.from_db()`
- `MakeValid(invalid_geometry).from_db('other')`
- `Unaccent(Lower('ÉtÉ')).from_db()`
This would have to be discussed on the developer mailing list and I
wouldn't be surprised if there was existing tickets tracking this feature
request.
--
Ticket URL: <https://code.djangoproject.com/ticket/30649#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.2578e37f06fae440b22033db007d7d72%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.