[Django] #34360: Django development server doesn't reload on TypeError of a CharField

6 views
Skip to first unread message

Django

unread,
Feb 21, 2023, 5:49:10 AM2/21/23
to django-...@googlegroups.com
#34360: Django development server doesn't reload on TypeError of a CharField
-------------------------------------+-------------------------------------
Reporter: dimyG | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 4.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
If you add "required=True" in the tier CharField below, a TypeError
exception is raised and development server doesn't reload.
Maybe this is related with https://code.djangoproject.com/ticket/30500

{{{
class User(AbstractUser):
tier_choices = (
(Tiers.free, 'Free'),
(Tiers.basic, 'Basic'),
(Tiers.premium, 'Premium'),
)

tier = models.CharField(max_length=10, choices=tier_choices,
default=Tiers.free, required=True)
}}}


{{{
File "d:\Projects_D\web_ai\auth\auth_src\auth_app\models.py", line 9, in
<module>
class User(AbstractUser):
File "d:\Projects_D\web_ai\auth\auth_src\auth_app\models.py", line 16,
in User
tier = models.CharField(max_length=10, choices=tier_choices,
default='free', required=True)
File "d:\Projects_D\web_ai\auth\py3107\lib\site-
packages\django\db\models\fields\__init__.py", line 1121, in __init__
super().__init__(*args, **kwargs)
TypeError: Field.__init__() got an unexpected keyword argument 'required'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34360>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 21, 2023, 7:20:05 AM2/21/23
to django-...@googlegroups.com
#34360: Django development server doesn't reload on TypeError of a CharField
-------------------------------------+-------------------------------------
Reporter: dimyG | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #5245, see
[https://code.djangoproject.com/ticket/5245#comment:14 comment].

--
Ticket URL: <https://code.djangoproject.com/ticket/34360#comment:1>

Reply all
Reply to author
Forward
0 new messages