#35815: System check for default database values with expressions prohibits non-
expressions
--------------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: Bug | Status: new
Component: Core (System checks) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Tim Graham):
The issue I see with requiring `Value` wrapping is that third-party apps
may not know to do it and therefore run into compatibility issues with
backends with `supports_expression_defaults = False`. For the other
solution I suggested, I'm not sure we can make the `isinstance()`check
exhaustive for all possible non-expression types.
Perhaps it's more appropriate to replace `isinstance(self.db_default,
Value)` with `not hasattr(self.db_default, "resolve_expression")` to
reject expressions.
--
Ticket URL: <https://code.djangoproject.com/ticket/35815#comment:4>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701926c504442-55b22a09-4437-43c6-baf1-6695ebf400d7-000000%40eu-central-1.amazonses.com.