Re: [Django] #30217: Admin form for DateTimeField does should require both fields

2019-02-27 Thread Django
#30217: Admin form for DateTimeField does should require both fields
-+-
 Reporter:  wKavey   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  2.1
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  admin field  | Triage Stage:
  validation |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  1
-+-

Comment (by Tim Graham):

 Please see TicketClosingReasons/UseSupportChannels for ways to get help.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.c85e5650862c9f8cf39f7fe7bc3832bc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30217: Admin form for DateTimeField does should require both fields

2019-02-27 Thread Django
#30217: Admin form for DateTimeField does should require both fields
-+-
 Reporter:  wKavey   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  2.1
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  admin field  | Triage Stage:
  validation |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  1
-+-

Comment (by wKavey):

 Hmm you're right. I think my issues are stemming from the fact that I
 force a call to self.full_clean() within my model's save() method


 {{{
 class BasicModel(models.Model):
 dt = models.DateTimeField()

 def clean(self, *args, **kwargs):
 super().clean(*args, **kwargs)

 if self.begin_dt is None:
 raise ValidationError("Cannot be None")

 def save(self, *args, **kwargs):
 self.full_clean()
 return super().save(*args, **kwargs)
 }}}

 I'm unsure of why it would be calling save() before it had completed
 validation of the form fields... any idea how I could work around this?
 There are some pretty stringent checks I am attempting to implement before
 any instance of this model is saved

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.0d9ff855f2ca7fb045722bb04018f22a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30217: Admin form for DateTimeField does should require both fields

2019-02-27 Thread Django
#30217: Admin form for DateTimeField does should require both fields
-+-
 Reporter:  wKavey   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  2.1
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  admin field  | Triage Stage:
  validation |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  1
-+-
Changes (by Johannes Hoppe):

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


Comment:

 Hi wKavey,

 I just tried to reproduce the issue you described an I can't. If a try to
 set the `User.date_joined` via the admin and omit the time, I get `This
 field is required.`. I tested this on the latest master.

 Maybe share a bit more information about the steps you took and you what
 you believe the error was.

 Best
 -Joe

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e4d3e8a09290b40bdf20931a1a7751cc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.