Opened 7 years ago

Closed 7 years ago

#11075 closed (invalid)

DateField on ManyToMany intermediary won't accept input

Reported by: David Baumgold Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords: manytomanyfield m2m datefield
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I cannot save() my m2m intermediary model, because it is throwing an error on a date validation. However, the date is correct -- it does not accept either a Python date object, or a properly formatted datestring. The object can be created and referenced successfully, but cannot be saved.

Full traceback demonstrating error is attached, and also here: http://dpaste.com/hold/43152/
As a reference, the relevant models are attached, and also here: http://dpaste.com/hold/43153/

Help? Is any more information needed?

Attachments (2)

error_traceback.txt (3.2 KB) - added by David Baumgold 7 years ago.
Traceback of error occurance
models.py (1.3 KB) - added by David Baumgold 7 years ago.
database models used when running traceback

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by David Baumgold

Attachment: error_traceback.txt added

Traceback of error occurance

Changed 7 years ago by David Baumgold

Attachment: models.py added

database models used when running traceback

comment:1 Changed 7 years ago by David Baumgold

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Proper syntax highlighting for models.py is at http://dpaste.com/hold/43158/

Also, forgot to mention: running Django 1.0.2, installed via easy_install.

comment:2 Changed 7 years ago by Ramiro Morales

Resolution: invalid
Status: newclosed

Your problem is your date_left = models.DateField(blank=True, default='') PerformanceGroupMembership field. Try with models.DateField(blank=True, null=True[, default=None]) instead, '' isn't a valid datetime.date value.

The tests/modeltests/m2m_through successfully running tests has an almost identical model setup (modulo the date_left field that is).

Also, next time please use the django user support channels (send a message to the django-users mailing list or visit the #django IRC channel) before opening a ticket here.

Note: See TracTickets for help on using tickets.
Back to Top