﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37324	Cannot assign expressions to spatial fields	Jacob Walls	Md. Saikat Islam	"`SpatialProxy` is too strict in the types it allows to be assigned to spatial fields -- it should allow expressions (if it can be implemented simply enough).

See [https://dryorm.xterm.info/spatial-field-expression-error fiddle]:
{{{#!py
from django.contrib.gis.db.models import PointField
from django.db import models

class Employee(models.Model):
    home = PointField()
    work = PointField()

def run():
    instance = Employee.objects.create(
        home=""POINT(1 1)"", work=""POINT(2 2)""
    )
    # Work from home.
    instance.work = models.F(""home"")
    instance.save()
}}}
{{{#!py
  File ""/usr/local/lib/python3.12/site-packages/django/contrib/gis/db/models/proxy.py"", line 82, in __set__
    raise TypeError(
TypeError: Cannot set Employee SpatialProxy (POINT) with value of type: <class 'django.db.models.expressions.F'>
}}}
----
Marking new feature, as we should document that we added support."	New feature	assigned	GIS	dev	Normal				Accepted	0	0	0	0	0	0
