DateField and TimeField rendered as textfield in Django

2021-12-04 Thread Vishal Pandey
Hi everyone, Whenever we use DateField and TimeField, django renders its html input field type as text. I know it could be changed by customising the attributes in form class, but why is not by default. I am also aware of the fact that date and time are supported by almost all browsers but not

Re: DateField is a string in model instance instead of datetime object

2021-08-29 Thread Sebastian Jung
Hello, I think this behaviour is absolut normal. When you create on a databasesystem a datefield and make a insert with this field with string '2021-08-21' then databasesystem convert this string automatical into date... So i think this has nothing to do with python/django and this b

DateField is a string in model instance instead of datetime object

2021-08-29 Thread 1oglop1
Hello, I have a problem that DateField or DateTime fields are `str` instead of datetime objects after the model has been instantiated/created. But when the model is returned from the database it is a correct object. How can I prevent this? given: ``` class My(models.Model): dt_obj

RE: DateTimeField to DateField

2021-08-12 Thread dupakoor kannan
randomize time through the custom import function. As I said before, time is optional. 2) Also, it appears the excel automatically changes the date format from 2021-06-03 to 6/3/21. I have to make sure both date format imports should work. 3) If I want to change the field from DateTimeField to DateField

Re: Change DateField Like this

2020-09-14 Thread coolguy
please explain in detail where do you want this change views? On Monday, September 14, 2020 at 3:56:37 PM UTC-4 kkwaq...@gmail.com wrote: > How to change date format in django (mmdd to ddmm) > -- You received this message because you are subscribed to the Google Groups "Django use

Change DateField Like this

2020-09-14 Thread kkwaq...@gmail.com
How to change date format in django (mmdd to ddmm) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view thi

Validation always True for CharField but not with DateField in FormSet

2020-06-05 Thread Rookie
StackOverflow: https://stackoverflow.com/questions/62206149/validation-always-true-blank-false-for-charfield-but-not-with-datefield I have an inlineformset_factory containing a field. When this field is a CharField (blank=False) and I run is_valid() on the formset, True is always returned even

Re: Django DateField

2018-07-08 Thread 'dtdave' via Django users
Many Thanks On Friday, 6 July 2018 16:13:35 UTC+1, Melvyn Sopacua wrote: > > On vrijdag 6 juli 2018 16:46:08 CEST 'dtdave' via Django users wrote: > > Many thanks for the help on this. I have implemented the following: > > models.py > > start_date = models.DateField(null=True, blank=True,) > >

Re: Django DateField

2018-07-06 Thread Swati Pushp
you want date auto genrate ?? On 6 July 2018 at 20:16, 'dtdave' via Django users < django-users@googlegroups.com> wrote: > Many thanks for the help on this. I have implemented the following: > models.py > start_date = models.DateField(null=True, blank=True,) > asap = models.BooleanField(default=F

Re: Django DateField

2018-07-06 Thread Melvyn Sopacua
On vrijdag 6 juli 2018 16:46:08 CEST 'dtdave' via Django users wrote: > Many thanks for the help on this. I have implemented the following: > models.py > start_date = models.DateField(null=True, blank=True,) > asap = models.BooleanField(default=False) > > I have amend my manager so the order is ri

Re: Django DateField

2018-07-06 Thread 'dtdave' via Django users
Many thanks for the help on this. I have implemented the following: models.py start_date = models.DateField(null=True, blank=True,) asap = models.BooleanField(default=False) I have amend my manager so the order is right on the template. The template is where I am going wrong. This what I have star

Re: Django DateField

2018-07-06 Thread Bill Torcaso
, July 5, 2018 at 1:05:47 PM UTC-4, dtdave wrote: > > I have a model that contains a datefield which signifies the start date > for a task. > My modelmanager filters the tasks by the start date and the template lists > them in the date descending order. Everything is fine with th

Re: Django DateField

2018-07-05 Thread Melvyn Sopacua
On donderdag 5 juli 2018 19:05:47 CEST 'dtdave' via Django users wrote: > However, now I have been asked to change this so that some projects have a > start date of ASAP and others have date. > These then need to be listed in my template with ASAP tasks coming first > and then those with a start d

Re: Django DateField

2018-07-05 Thread Jim Illback
' via Django users mailto:django-users@googlegroups.com>> wrote: I have a model that contains a datefield which signifies the start date for a task. My modelmanager filters the tasks by the start date and the template lists them in the date descending order. Everything is fine with thi

Django DateField

2018-07-05 Thread 'dtdave' via Django users
I have a model that contains a datefield which signifies the start date for a task. My modelmanager filters the tasks by the start date and the template lists them in the date descending order. Everything is fine with this. However, now I have been asked to change this so that some projects

Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
*solved* forms.DateInput.input_type="date" forms.DateTimeInput.input_type="datetime-local" -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubsc

Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
Hi,i tried that and got this. Double "type" (no override). -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post t

Re: modelform DateField rendering as text

2018-01-23 Thread Daniel Roseman
On Tuesday, 23 January 2018 07:17:48 UTC, Ruchit Bhatt wrote: > > Is there any bootstrap hack to fix this ?? > You don't need a hack, you can just set the type manually: self.fields['birth_date'].widget.attrs['type'] = 'date' -- DR. -- You received this message because you are subscribed

Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
Is there any bootstrap hack to fix this ?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send

Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
yes, it should be ok i will check that link -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, s

Re: modelform DateField rendering as text

2018-01-22 Thread Costja Covtushenko
Hi, Do you mean that it should be rendered like: ? If so check that documentation page . It is said that DateInput renders as type=’text’. If you are curios why it is done in that way, please ask at: django-develo

modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
*models.py* class HumanUser(AbstractUser): birth_date = models.DateField(null=True, blank=True, verbose_name=u "DOB") *forms.py* class profile_form(forms.ModelForm): def __init__(self, *args, **kwargs): kwargs.setdefault('label_suffix', '') super(profile_form, self

Datefield model not show Today and Calender options in Admin page

2017-10-29 Thread Oğuzhan Arslan
Why Today and Calender option do not show in admin page ? This fields calender and Today option displayed two days ago. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an e

Re: DateField does not update the date provided by hand

2017-07-27 Thread Mike Dewhirst
On 27/07/2017 9:14 PM, pablochud wrote: Yeah, but I would like datepicker too. if I changed it to CharField I would loose datepicker True. Looks like you might have to dig into the javascript source for the widget and make your own datepicker which takes random user input and figures out what

Re: DateField does not update the date provided by hand

2017-07-27 Thread pablochud
Yeah, but I would like datepicker too. if I changed it to CharField I would loose datepicker > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+

Re: DateField does not update the date provided by hand

2017-07-27 Thread Mike Dewhirst
On 27/07/2017 6:41 PM, pablochud wrote: Hi, is it normal that DateField make me to pick a date from datepicker and do not let me update the field by hand? - when trying to set a date by hand it automatically changing to date selected on datepicker. How can I let User to choose date both way

DateField does not update the date provided by hand

2017-07-27 Thread pablochud
Hi, is it normal that DateField make me to pick a date from datepicker and do not let me update the field by hand? - when trying to set a date by hand it automatically changing to date selected on datepicker. How can I let User to choose date both way? :) -- You received this message because

Re: SelectDateWidget when DateField is not required

2017-06-30 Thread Tim Graham
'from_date': forms.SelectDateWidget(years=years), > 'through_date': forms.SelectDateWidget(years=years) > } > > > > As we can see, this DateField is not required. And have an empty choice > at the top of the list (&q

Re: SelectDateWidget when DateField is not required

2017-06-12 Thread Melvyn Sopacua
On Monday 12 June 2017 03:28:29 Nonverbis M wrote: > There is that method clean_through_date and the break point in it. But > in case of incomplete set of month, day and year the program will not > even call this clean_through_date() method. This method is called in > two cases: > > 1) if the thr

SelectDateWidget when DateField is not required

2017-06-12 Thread Nonverbis M
'from_date': forms.SelectDateWidget(years=years), 'through_date': forms.SelectDateWidget(years=years) } As we can see, this DateField is not required. And have an empty choice at the top of the list ("---"). The problem is that when a u

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
rent backends, they will have different >>>> bugs, performance and ultimately different behaviour >>>> >>>> On Wed, Jan 4, 2017 at 1:47 PM, wrote: >>>> >>>>> The fact that some backends are more forgiving is exactly my point. &g

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread jorrit787
M, wrote: >>> >>>> The fact that some backends are more forgiving is exactly my point. >>>> Maybe the migrations engine should always force a datetime object (or at >>>> least a -MM-DD notation) to make it work consistently on all backend

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Antonis Christofides
be the migrations engine should always force a datetime >> object (or at least a -MM-DD notation) to make it work >> consistently on all backends. >> >> >> On Wednesday, January 4, 2017 at 11:35:38 AM UTC+1, Avraham >&g

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
; bugs, performance and ultimately different behaviour >> >> On Wed, Jan 4, 2017 at 1:47 PM, wrote: >> >>> The fact that some backends are more forgiving is exactly my point. >>> Maybe the migrations engine should always force a datetime object (or at >>>

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Antonis Christofides
e: > > The fact that some backends are more forgiving is exactly my point. > Maybe the migrations engine should always force a datetime object (or > at least a -MM-DD notation) to make it work consistently on all > backends. > > >

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread jorrit787
always force a datetime object (or at least a >> -MM-DD notation) to make it work consistently on all backends. >> >> >> On Wednesday, January 4, 2017 at 11:35:38 AM UTC+1, Avraham Serour wrote: >>> >>> DateField is a representation of datetime.date,

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
ions engine should always force a datetime object (or at least a > -MM-DD notation) to make it work consistently on all backends. > > > On Wednesday, January 4, 2017 at 11:35:38 AM UTC+1, Avraham Serour wrote: >> >> DateField is a representation of datetime.date, so you sho

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread jorrit787
: > > DateField is a representation of datetime.date, so you should assign a > date object and not a string, sqlite is more forgiving and doesn't complain > so much in many cases > > On Wed, Jan 4, 2017 at 12:13 AM, > wrote: > >> This field: >> >> activity_

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
DateField is a representation of datetime.date, so you should assign a date object and not a string, sqlite is more forgiving and doesn't complain so much in many cases On Wed, Jan 4, 2017 at 12:13 AM, wrote: > This field: > > activity_date = models.DateField('Datum&#x

Re: DateField default value in SQLite and Postgres

2017-01-03 Thread jorrit787
This field: activity_date = models.DateField('Datum', default='17/06/2017') Results in this migration: class Migration(migrations.Migration): dependencies = [ ('activities', '0006_auto_20161231_1703'), ] operations = [ migrations.AlterField( model_name=

Re: DateField default value in SQLite and Postgres

2017-01-03 Thread Avraham Serour
please post your migration file and the error On Tue, Jan 3, 2017 at 12:00 PM, wrote: > I recently set a default value in my local date format on a DateTimeField > while I was using SQLite. The migration ran fine on my SQLite dev database, > but when trying to apply the migration on my productio

DateField default value in SQLite and Postgres

2017-01-03 Thread jorrit787
I recently set a default value in my local date format on a DateTimeField while I was using SQLite. The migration ran fine on my SQLite dev database, but when trying to apply the migration on my production Postgres database I got an error saying that a default value for DateTimeField must be in

Re: DateField default value

2016-08-22 Thread Rich Shepard
On Mon, 22 Aug 2016, Tim Graham wrote: What do you mean by "not accepted"? Is there some error message? What you wrote should work as far as I know. Tim, Yes, there was an error message that was not saved. from datetime import date That's probably the cause: my missing that import in

Re: DateField default value

2016-08-22 Thread Tim Graham
What do you mean by "not accepted"? Is there some error message? What you wrote should work as far as I know. from datetime import date pub_date = models.DateField(default=date.today) On Monday, August 22, 2016 at 7:04:11 PM UTC-4, Rich Shepard wrote: > > Reading the doc f

Re: DateField default value

2016-08-22 Thread Mike Dewhirst
On 23/08/2016 9:03 AM, Rich Shepard wrote: Reading the doc for DateField() I tried to set the default as today's date, but 'default=date.today' is not accepted. If there is a way to set today's data as the default for a DateField() please point me to the

DateField default value

2016-08-22 Thread Rich Shepard
Reading the doc for DateField() I tried to set the default as today's date, but 'default=date.today' is not accepted. If there is a way to set today's data as the default for a DateField() please point me to the doc for it. Thanks, Rich

Re: DateField(blank=True), null?

2015-06-25 Thread Siddharth Tanna
, ou have any other solution? >> >> On Monday, August 14, 2006 at 12:09:53 PM UTC+5:30, Bryan Chow wrote: >>> >>> Hi Ray, >>> >>> You can set null=True on your DateField to allow null values in the >>> database. Foe example: >>> &g

Re: DateField(blank=True), null?

2015-06-25 Thread Mario Gudelj
ryan Chow wrote: >> >> Hi Ray, >> >> You can set null=True on your DateField to allow null values in the >> database. Foe example: >> >> thedate = models.DateField(null=True, blank=True) >> >> Cheers, >> Bryan >> >> &

Re: DateField(blank=True), null?

2015-06-25 Thread Sidh Tanna
Its not work dear, ou have any other solution? On Monday, August 14, 2006 at 12:09:53 PM UTC+5:30, Bryan Chow wrote: > > Hi Ray, > > You can set null=True on your DateField to allow null values in the > database. Foe example: > > thedate = models.DateField(null=True, b

Re: DateField displayed as (None) in admin

2013-04-10 Thread Tomas Pelka
I forgot to mention this is Django 1.5.1. Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group,

DateField displayed as (None) in admin

2013-04-10 Thread Tomas Pelka
Hi all, for some reason Dates are displayed as (None) in admin and in shell as well. model.py: # -*- coding: utf-8 -*- from django.db import models from django.contrib import admin class Record(models.Model): date = models.DateField(_('Čas zadání'), null=True, blank=True) #, auto_now=True,

Re: Django 1.4 admin. Calendar widget appears for DateTimeField but not DateField

2012-08-16 Thread Lachlan Musicman
de is in the page at all Cheers L. On Thu, Aug 16, 2012 at 10:40 PM, grimmus wrote: > I have checked for missing resources (jquery etc.) but all external assets > are being loaded correctly. It's just that nothing appears beside the > textbox for the DateField ! > > Anyone an

Django 1.4 admin. Calendar widget appears for DateTimeField but not DateField

2012-08-16 Thread grimmus
I have checked for missing resources (jquery etc.) but all external assets are being loaded correctly. It's just that nothing appears beside the textbox for the DateField ! Anyone any ideas why this might be happening ? Thanks -- You received this message because you are subscribed t

Re: Can't display DateField on form with auto_now = True

2012-04-05 Thread Joel Goldstick
y form to be rendered.  I don't want them > to be editable, but I would like to display at the top of my form. > How can I do this? > -- > Joel Goldstick I also posted this on Stack Exchange, and kept at it on my own. I came up with a solution here: http://stackoverflow.com/qu

Can't display DateField on form with auto_now = True

2012-04-05 Thread Joel Goldstick
I have a model with auto_now, and auto_now_add set for Update and Create fields: class HotelProfiles(models.Model): fe_result_id = models.AutoField(primary_key=True) fe_created_date = models.DateTimeField(verbose_name='Created', blank=True, auto_now_add=True) fe_updated_date = models.Da

DateField - format in Django 1.3.1

2012-02-29 Thread Xavier Pegenaute
Hi, I saw there was some problems in the format which is rendered, validated and stored using a DateField in a form, and in a model. Are they still unresolved in 1.3.1 versio?, it's not working for me My form: 32 class EventForm(forms.Form): 33 name = forms.CharField(label=_(

Django - ValidationError on saving a model instance containing DateField

2011-11-26 Thread luke lukes
hi everyone. I'm working on this view: http://dpaste.com/661995/ and i have a ValidationError while trying to save the model instance. the error is 'Enter a valid date in -MM-DD format'. the datefield is correctly filled, the type of instance passed to model is unicode. I have

Re: DateField min_value

2011-11-17 Thread Andre Terra
e: > -1 > If you need to limit the latest date a user can input, do it while > cleaning your form > > On 11/17/11, Michael Nacharov wrote: > > Hello Django Expets! > > In one of my Django app, users must fill some forms with Django > > DateField. Why this class doe

Re: DateField min_value

2011-11-16 Thread kenneth gonsalves
On Thu, 2011-11-17 at 08:10 +0100, Babatunde Akinyanmi wrote: > Also, if you want to suggest new features for django, you will have to > do that in django-develop group otherwise you won't get the core > developers to see your suggestions. not so - this is the correct list for suggestions. And th

Re: DateField min_value

2011-11-16 Thread Babatunde Akinyanmi
do it while > cleaning your form > > On 11/17/11, Michael Nacharov wrote: >> Hello Django Expets! >> In one of my Django app, users must fill some forms with Django >> DateField. Why this class does not contain field max_value? Perhaps it >> is worth a new ticket? >&

Re: DateField min_value

2011-11-16 Thread Babatunde Akinyanmi
-1 If you need to limit the latest date a user can input, do it while cleaning your form On 11/17/11, Michael Nacharov wrote: > Hello Django Expets! > In one of my Django app, users must fill some forms with Django > DateField. Why this class does not contain field max_value? Perhap

DateField min_value

2011-11-16 Thread Michael Nacharov
Hello Django Expets! In one of my Django app, users must fill some forms with Django DateField. Why this class does not contain field max_value? Perhaps it is worth a new ticket? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Datefield

2011-02-16 Thread william ratcliff
atrick.sz...@lexisnexis.at> wrote: > Hi, > > > > I built my own view where users can add new DB-entries. > > I have a DateField and generated the Form for it directly from the model > but i don’t see this calender-icon like i do in the admin panel. > > How ca

Datefield

2011-02-16 Thread Szabo, Patrick (LNG-VIE)
Hi, I built my own view where users can add new DB-entries. I have a DateField and generated the Form for it directly from the model but i don't see this calender-icon like i do in the admin panel. How can I add it ?! Is it enough to just reference to the .js in the tem

Re: DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle
Thank you. Problem solved. On Wednesday, January 05, 2011 03:58:59 pm Shawn Milochik wrote: > http://docs.djangoproject.com/en/dev/ref/forms/widgets/ > > Search for "year" on this page and it has what you need. > > Shawn -- Mike Seidle -- You received this message because you are subscribe

Re: DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Shawn Milochik
http://docs.djangoproject.com/en/dev/ref/forms/widgets/ Search for "year" on this page and it has what you need. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsub

DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle
Well, 2011 brought a bug I'm not sure what to do with. I have a view that contains a form that lets a user select a date range. The field is defined as start_date = forms.DateField(initial=date(d.year,d.month,1),widget=SelectDateWidget()) My problem is that as of the 1st of January 2011, the

Re: Extracting days,months,years from datefield.

2010-12-31 Thread James Bennett
p. How can I extract that info from > a datefield? I have tried to read code written by others but their solutions > are not very obvious to me. The value of a Datefield is a Python datetime.date object. To see the attributes of datetime.date instances, which include what you want here,

Extracting days,months,years from datefield.

2010-12-31 Thread Malte Beckmann
I got a models.DateField and would like to extract months and years from that field so I can do calculations like a 'day in month' in a 'for month in months' loop in a 'for year in years' loop. How can I extract that info from a datefield? I have tried to read co

Re: Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread Paulo Almeida
lo On Fri, Aug 6, 2010 at 12:24 AM, flowpoke wrote: > I have a simple model that includes two DateField fields. I have > everything passing to the template, as I would like but i'd like to > add one more variable, duration. I want {{ duration }} to be that of > the delta between t

Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread flowpoke
I have a simple model that includes two DateField fields. I have everything passing to the template, as I would like but i'd like to add one more variable, duration. I want {{ duration }} to be that of the delta between the two DateField fields, in years. It's simple arithmetic but i

Re: Problem with DateField input_formats

2010-06-23 Thread Karen Tracey
On Wed, Jun 23, 2010 at 11:34 AM, bax...@gretschpages.com < mail.bax...@gmail.com> wrote: > I have: > > DATE_INPUT_FORMATS = ( >'%n/%j/%Y', '%n/%j/%y', # '10/25/2006', '10/25/06' >'%n-%j-%Y', '%n-%j-%y', # '10-25-2006', '10-25-06' >'%M %j %Y', '%M %j, %Y', # 'Oct 25 2006', 'Oct 25, 2

Problem with DateField input_formats

2010-06-23 Thread bax...@gretschpages.com
I have: DATE_INPUT_FORMATS = ( '%n/%j/%Y', '%n/%j/%y', # '10/25/2006', '10/25/06' '%n-%j-%Y', '%n-%j-%y', # '10-25-2006', '10-25-06' '%M %j %Y', '%M %j, %Y', # 'Oct 25 2006', 'Oct 25, 2006' '%b %j %Y', '%b %j, %Y', # 'oct 25 2006', 'oct 25, 2006' '%F %j %Y', '%F %j, %Y', # 'O

Re: DateField issues

2010-06-17 Thread Daniel Roseman
birth) field a Date object initialized to something arbitrary. Does > the DateField not get along with standard date objects? What format > should stuff be in for populating DateFields? For some reason you're trying to set the value of your date fields to a *field*. Just as with any othe

Re: DateField issues

2010-06-16 Thread Alexander Jeliuc
Here is DateField class I think You will find all You need here class DateField(Field): description = _("Date (without time)") empty_strings_allowed = False default_error_messages = { 'invalid': _('Enter a valid date in -MM-DD format.

Re: DateField issues

2010-06-16 Thread Alexander Jeliuc
Date object initialized to something arbitrary. Does > the DateField not get along with standard date objects? What format > should stuff be in for populating DateFields? > > On Jun 17, 7:24 am, Alexander Jeliuc wrote: > > read about autofill_now=True and autofill=True > > &g

Re: DateField issues

2010-06-16 Thread Sheena
s the DateField not get along with standard date objects? What format should stuff be in for populating DateFields? On Jun 17, 7:24 am, Alexander Jeliuc wrote: > read about autofill_now=True and autofill=True > > On Thu, Jun 17, 2010 at 8:14 AM, Sheena wrote: > > I've defined a

Re: DateField issues

2010-06-16 Thread Alexander Jeliuc
isinstance(f, AutoField)] > File "/usr/lib/pymodules/python2.6/django/db/models/fields/ > __init__.py", line 192, in get_db_prep_save >return self.get_db_prep_value(value) > File "/usr/lib/pymodules/python2.6/django/db/models/fields/ > __init__.py", line 511,

DateField issues

2010-06-16 Thread Sheena
prep_value(value) File "/usr/lib/pymodules/python2.6/django/db/models/fields/ __init__.py", line 511, in get_db_prep_value return connection.ops.value_to_db_date(self.to_python(value)) File "/usr/lib/pymodules/python2.6/django/db/models/fields/ __init__.py", line 472, i

Re: Django ValidationError for DateField

2010-05-05 Thread Karen Tracey
On Wed, May 5, 2010 at 5:33 PM, LeeRisq wrote: > This is mostly me just venting, but why is it if you run a query like > this: > > a = Model.objects.get(pk=1) > > Which has an attribute with an output of: > > a.date = None > > I pass that to a template, change some other attribute and then > atte

Django ValidationError for DateField

2010-05-05 Thread LeeRisq
This is mostly me just venting, but why is it if you run a query like this: a = Model.objects.get(pk=1) Which has an attribute with an output of: a.date = None I pass that to a template, change some other attribute and then attempt to pass it back in: date = request.GET['a.date'] b = Model.obj

Re: Problem with DateField (Rooky)

2010-02-22 Thread Shawn Milochik
DEFAULT_DATE_INPUT_FORMATS is on the deprecation timeline, just FYI. The formatting options are for the way data can be input into a form object. Django always stores dates the same way (per database backend). Are you using Django with an already-existing database full of data? Also, your code

Problem with DateField (Rooky)

2010-02-22 Thread anvasila
My DataBase has the dates like "2003-08-31" and the django take them like this: "May 9, 2024".How can i change that in Django? At first i was trying something like this date=models.DateField(default="%Y-%m- %d) Next is try this: from django import forms from django.forms.fields import DEFAULT_D

DateField input_formats in auto-generated generic view forms

2010-01-30 Thread Baurzhan Ismagulov
Hello, Is it possible to specify DateField input_formats somewhere (e.g., in a model or a global setting) without overriding the generic view (create_update.create_object, create_update.update_object) forms? I'm using 1.0. Thanks in advance, -- Baurzhan Ismagulov http://www.kz-eas

Re: Admin calendar popups on datefield suddenly missing

2010-01-22 Thread Bill Freeman
Note that the net tab in firebug is one way to see which references aren't loading. On Fri, Jan 22, 2010 at 6:26 AM, David De La Harpe Golden wrote: > Walt wrote: >> Okay, we're getting somewhere. It can find the JS file(s) just fine > > The static files maybe. > >> and I see that the calendars a

Re: Admin calendar popups on datefield suddenly missing

2010-01-22 Thread David De La Harpe Golden
Walt wrote: > Okay, we're getting somewhere. It can find the JS file(s) just fine The static files maybe. > and I see that the calendars are added dynamically. However, I'm > have found that it is generating a javascript error when the page > loads: > > Error: gettext is not defined Now, I'm wo

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Ramiro Morales
On Thu, Jan 21, 2010 at 5:31 PM, Walt wrote: > Okay... The latest release of django that I downloaded has this: > > > A previous version that is currently working is this: > > > How can I modify or specify that path? And why would it have > changed? Because in the development version that was [

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Okay... The latest release of django that I downloaded has this: A previous version that is currently working is this: How can I modify or specify that path? And why would it have changed? Thanks, Walt -~ -- You received this message because you are subscribed to the Google Groups "Django u

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
That line is there, but for some reason *that* is the broken link! That at least gives me something to track down... Thank you for your help! Walt -~ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Daniel Roseman
On Jan 21, 5:51 pm, Walt wrote: > Okay, we're getting somewhere. It can find the JS file(s) just fine > and I see that the calendars are added dynamically. However, I'm > have found that it is generating a javascript error when the page > loads: > > Error: gettext is not defined > Source File:http

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Okay, we're getting somewhere. It can find the JS file(s) just fine and I see that the calendars are added dynamically. However, I'm have found that it is generating a javascript error when the page loads: Error: gettext is not defined Source File: http://tachamber.org/media/admin/js/calendar.js L

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Carl Zmola
Make sure you can download the JS file. It could be a permissions problem, or your static content server is down. Walt wrote: On Jan 21, 10:28 am, Daniel Roseman wrote: Do you have TinyMCE on the same admin page? And are you using Firefox 3.5+? If so it might be this bug:http://code.djang

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
On Jan 21, 10:28 am, Daniel Roseman wrote: > > Do you have TinyMCE on the same admin page? And are you using Firefox > 3.5+? If so it might be this bug:http://code.djangoproject.com/ticket/11967 No, I don't think this is the problem. First, I'm not using TinyMCE on the app at all, secondly, the p

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Daniel Roseman
On Jan 21, 3:23 pm, Walt wrote: > Hi all, > > I don't know of any changes I've made recently other than > checking out the latest django code but the date picker / > popup on all admin datefields has suddenly disappeared. > > Any clues as to how to get this back or what might have > caused it to d

Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Hi all, I don't know of any changes I've made recently other than checking out the latest django code but the date picker / popup on all admin datefields has suddenly disappeared. Any clues as to how to get this back or what might have caused it to disappear in the first place? Thanks, Walt -~

Re: comparing datefield

2009-12-17 Thread Russell Keith-Magee
On Thu, Dec 17, 2009 at 6:42 PM, Daniel Roseman wrote: > On Dec 17, 10:10 am, gganesh wrote: >> hi group, >>  How to compare date field types in a template ,a have field due_on >> taking DateField type .I have to compare to present date .I have tried >> the following i

Re: comparing datefield

2009-12-17 Thread Daniel Roseman
On Dec 17, 10:10 am, gganesh wrote: > hi group, >  How to compare date field types in a template ,a have field due_on > taking DateField type .I have to compare to present date .I have tried > the following in vain ,please help > In a template > {% if enquiry.due_on >= da

comparing datefield

2009-12-17 Thread gganesh
hi group, How to compare date field types in a template ,a have field due_on taking DateField type .I have to compare to present date .I have tried the following in vain ,please help In a template {% if enquiry.due_on >= datetime.datetime.today %} .{% end if %} and {% if enquiry.due_on_

For DateField, render() gets date object in some cases, but unicode datestring in other

2009-11-25 Thread Margie Roginski
I have a TaskForm that contains a DateField. If I create my form from an instance of a Task, I find that when I render the DateField field, the value argument to render() is an actual datetime.date object. However, if I create my form from POST data, the value argument to render() is just a

Re: Django Admin: DateField (Year and Month) only

2009-10-19 Thread Joshua Russo
ast reply, > > > d > > > > On Oct 20, 10:38 am, Joshua Russo wrote: > > On Mon, Oct 19, 2009 at 10:28 PM, The Danny Bos > wrote: > > > > > > > > > Hiya, > > > > > In the Django Admin for the DateField I only want to displa

  1   2   3   >