Opened 10 years ago

Closed 10 years ago

#387 closed defect (worksforme)

Date field does not render, saving object fails with invisible error

Reported by: al3x@… Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm creating a sample application with a model very similar to the "blog" app powering the Django site. When I go to create a new Entry I do not see the javascript helpers for the pub_date field. I've tried this in Safari and Firefox, checked out the DOM trees and Javascript debuggers in both, and the problem does not seem to be on the client side.

When I go to save an Entry I see "Please correct the error below," but no error below. I'm guessing it's failing on the lack of values for the DateTimeField, although I do have auto_now_add=True.

Attachments (1)

Broken date field.png (29.8 KB) - added by al3x@… 10 years ago.
Screenshot of the broken DateTimeField in Safari 2.0 (412.2.2), generated by Django svn rev 544

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by al3x@…

Screenshot of the broken DateTimeField in Safari 2.0 (412.2.2), generated by Django svn rev 544

comment:1 Changed 10 years ago by aCC

Usage changed, but was only documented in IRC. Instead of "auto_now_add=True" you should use "default=meta.LazyDate()".

Doesn't add the Javascript, but at least it fills the fields properly.

comment:2 Changed 10 years ago by Alex Payne <al3x@…>

  • Resolution set to worksforme
  • Status changed from new to closed

Using "default=meta.LazyDate()" works, and actually does get the Javascript calendar stuff going for me. It'd be great if this stuff got documented!

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