List Info

Thread: DateTimeField




DateTimeField
user name
2006-07-27 15:53:00
Is it possible to use a DateTimeField from a model
definition as an
input field in a form?

I have
class MyTest(meta.Model):
      Subject=meta.CharField( maxlength=90)
      Description=meta.TextField()
     
CurrentBid=meta.IntegerField(maxlength=6,blank=True,null=Tru
e)
      StartTime=meta.DateTimeField(auto_now_add=True)
      EndTime=   meta.DateTimeField()
      BidIncrement=meta.FloatField(max_digits=6,
decimal_places=2)
      mytests=meta.ForeignKey(User)

and in a form I have

....
....
 <tr >
      <td width="2%"></td>
      <td width="16%"><strong>End
time</strong></td>
<td
width="82%">{{form.EndTime}}</td>
       </tr>
..
...

but there is no input field in the form for EndTime

Why?
Thank you.
L.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

DateTimeField
user name
2006-07-27 18:07:14
Can you get it to show up in the admin area? I've had to
reverse
engineer several things by digging through the admin area
code and
applying it to my own stuff.

I'm having a similar problem with a date field, I'm just
trying to
update a date with a hidden field and nothing seems to work.
It just
stays NULL. Could be a similar issue.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

DateTimeField
user name
2006-07-27 20:21:36
I believe you need 2 fields on your form:

{{form.EndTime.time}} and {{form.EndTime.date}}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

DateTimeField
user name
2006-07-28 06:34:14
jrs,
I tried to use {{form.EndTime.time}} and
{{form.EndTime.date}}  in a
form but still NO input field is shown.
Do you have any suggestion why?
Thank you
L


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

DateTimeField
user name
2006-07-28 08:38:53
I found the solution.
It must be
{{form.EndTime_date}}  {{form.EndTime_time}}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

DateTimeField
user name
2006-07-28 14:16:04
nice - this worked for my hidden field update as well.
Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )