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: want to take input of datetimefield from my template

2020-07-14 Thread Kasper Laudrup
Hi Chander, On 14/07/2020 17.08, chander shekhar wrote: Anyone help me I did try to give you some advice on something you could do. Did you try that? How did it work out? It's very hard for anyone to help you if you're not providing any information. Kind regards, Kasper Laudrup -- You

Re: want to take input of datetimefield from my template

2020-07-14 Thread chander shekhar
Anyone help me On Tue, Jul 14, 2020, 12:01 AM chander shekhar wrote: > I think here millisecond or microseconds are not coming ,in django-admin > it is coming with microseconds > > On Mon, Jul 13, 2020, 11:57 PM Kasper Laudrup > wrote: > >> Hi Chander, >> >> On 13/07/2020 20.07, chander shekhar

Re: want to take input of datetimefield from my template

2020-07-13 Thread chander shekhar
I think here millisecond or microseconds are not coming ,in django-admin it is coming with microseconds On Mon, Jul 13, 2020, 11:57 PM Kasper Laudrup wrote: > Hi Chander, > > On 13/07/2020 20.07, chander shekhar wrote: > > #forms.py > > > > classeventform(forms.ModelForm): > > > > classMeta: > >

Re: want to take input of datetimefield from my template

2020-07-13 Thread Kasper Laudrup
Hi Chander, On 13/07/2020 20.07, chander shekhar wrote: #forms.py classeventform(forms.ModelForm): classMeta: model = Event fields = [, 'end_time',] widgets = { 'start_time':  forms.DateTimeInput(attrs={'type': 'datetime-local'}), Look at the format attribute

Re: want to take input of datetimefield from my template

2020-07-13 Thread chander shekhar
ate > > > > {% csrf_token %} > > > > {{form.as_p}} > > > > ADD > > > > > > > Regards > Chander Shekhar > (bestcsp) > > > On Mon, Jul 13, 2020 at 8:18 PM coolguy > wrote: > >> Please share your mo

Re: want to take input of datetimefield from my template

2020-07-13 Thread chander shekhar
gt;> wrote: >> >>> On July 12, 2020 3:02:00 PM GMT+02:00, Chander shekhar < >>> best...@gmail.com> wrote: >>> >starttime=datetimefield() >>> > >>> >i want to take datetimefield from my template but i am not able to do >>> >i

Re: want to take input of datetimefield from my template

2020-07-13 Thread coolguy
Please share your model, view and template for more clarity. Thanks On Sunday, July 12, 2020 at 9:25:16 AM UTC-4, Chander shekhar wrote: > > > On Sun, Jul 12, 2020, 6:37 PM Kasper Laudrup > wrote: > >> On July 12, 2020 3:02:00 PM GMT+02:00, Chander shekhar > > wrote:

Re: want to take input of datetimefield from my template

2020-07-12 Thread Kasper Laudrup
On July 12, 2020 3:02:00 PM GMT+02:00, Chander shekhar wrote: >starttime=datetimefield() > >i want to take datetimefield from my template but i am not able to do >it. >i have created the form and passed the widget of datetime-local but it >is >not acceptable ,it is giving m

want to take input of datetimefield from my template

2020-07-12 Thread Chander shekhar
starttime=datetimefield() i want to take datetimefield from my template but i am not able to do it. i have created the form and passed the widget of datetime-local but it is not acceptable ,it is giving me error . Help me to resolve it . It's important -- You received this message becaus

Re: how to change the format of datetimefield model

2020-07-08 Thread oba stephen
See if this might help https://blog.ipswitch.com/date-formatting-in-python#:~:text=To%20do%20that%2C%20I'd,day%2C%20month%20and%20year%20is. see full documentation here https://docs.python.org/3.4/library/datetime.html#strftime-and-strptime-behavior On Wed, Jul 8, 2020 at 5:01 PM Chander shekhar

how to change the format of datetimefield model

2020-07-08 Thread Chander shekhar
my default date time format is something like 2018-07-01 I want to change it like 01-01-2018 Can any one help me in finding it -- 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, sen

Re: DateTimeField is in UTC but need IST standards

2019-04-30 Thread vineeth sagar
whenever USE_TZ=True is enabled, the timestamp is stored as a UTC object. This is standard practice, why? https://docs.djangoproject.com/en/2.2/topics/i18n/timezones/ Go through this, more than once. It'll be helpful. On Tue, 30 Apr 2019, 18:09 Sampath Reddy, wrote: > Hey guys, > > I am using

DateTimeField is in UTC but need IST standards

2019-04-30 Thread Sampath Reddy
Hey guys, I am using DjangoRestFramework as tech stack to develop backend API points for my application. I have a model with field created = models.DateTimeField(auto_now_add=True) in one of the models. I am using mysql as backend db, now the problem I am having is I am not able to figure out ho

inserting data in a DateTimeField() in Django by using datetime-local

2018-12-07 Thread Godson Rapture
Please, I am creating a to-do list app as my first django project. My form is not valid because I am trying to insert DateTimeField in django using datetime-local. I did research, I discovered I need to do a custom model so I parse the datetime-local field. Pls guide me on how to create a

Re: Initializing DateTimeField in django forms.

2018-02-20 Thread Ryan Nowakowski
You could make the date field "disabled": https://docs.djangoproject.com/en/2.0/ref/forms/fields/#disabled On Mon, Feb 19, 2018 at 08:37:40AM -0800, prince gosavi wrote: > That did the job.But I would like to get rid of the 'Field' type view that > surrounds the date. As I only want to display th

Re: Initializing DateTimeField in django forms.

2018-02-19 Thread Jani Tiainen
Hi. If you want to display only date why aren't you doing it in template rather than trying to make form to just display value. 19.2.2018 18.38 "prince gosavi" kirjoitti: > That did the job.But I would like to get rid of the 'Field' type view that > surrounds the date. As I only want to display

Re: Initializing DateTimeField in django forms.

2018-02-19 Thread prince gosavi
That did the job.But I would like to get rid of the 'Field' type view that surrounds the date. As I only want to display the date. Is there a way to do it in the form itself or any way to change it in the templates? On Monday, February 19, 2018 at 7:52:05 PM UTC+5:30, prince gosavi wrote: > > H

Re: Initializing DateTimeField in django forms.

2018-02-19 Thread Etienne Robillard
i think you need to replace: form = UserQueryForm() with form = UserQueryForm(initial={'date': date}) See: https://docs.djangoproject.com/en/2.0/ref/forms/api/ Etienne Le 2018-02-19 à 10:31, prince gosavi a écrit : | # my_app/views.py fromdjango.shortcuts importrender,get_object_or_404 #

Re: Initializing DateTimeField in django forms.

2018-02-19 Thread prince gosavi
# my_app/views.py from django.shortcuts import render, get_object_or_404 # Create your views here. from .models import User from .forms import UserQueryForm def home(request): # home page a_list = User.objects.filter() for item in a_list: context = {'username': item.username,'conta

Re: Initializing DateTimeField in django forms.

2018-02-19 Thread Etienne Robillard
How does your view looks like? Etienne Le 2018-02-19 à 09:18, prince gosavi a écrit : Hi, I am building a simple django application for user feedback. And I have created a form for that purpose. Here is the snippet: | # my_app/forms.py fromdjango importforms importdatetime classUserQueryF

Initializing DateTimeField in django forms.

2018-02-19 Thread prince gosavi
Hi, I am building a simple django application for user feedback. And I have created a form for that purpose. Here is the snippet: # my_app/forms.py from django import forms import datetime class UserQueryForm(forms.Form): date = forms.DateField(initial=datetime.date.today) # need help u

Re: DateTimeField Outside Admin

2016-11-27 Thread M Hashmi
Its simple. In your view in your context dictionary create a variable for date. Import timezone and date = timezone.now(). You can declared "date" like {{ date }} in any of your template and you will get date coming up. On Sun, Nov 27, 2016 at 8:50 AM, Elias Coutinho wrote: > > >

DateTimeField Outside Admin

2016-11-27 Thread Elias Coutinho
Good afternoon people, I would like to dis

DateTimeField, auto_now_add, and makemigrations

2016-10-19 Thread Jim
els.DateTimeField(default=datetime.datetime.now, blank= True) it said this: */usr/local/lib/python3.4/dist-packages/django/db/models/fields/__init__.py:1430: RuntimeWarning: DateTimeField TootUser.signup_datetime received a naive datetime (2016-10-19 13:48:14.145943) while time zone support is active. Runt

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-09-01 Thread Serena
Thank you very much, now if I work. And besides I also served to enhance most of my consultations with dates. It is strange that I have not tried that way, if a large part of my consultations I had done that way, well, the important thing is that it works and I understand the reason. Thanks for

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread James Schneider
On Mon, Aug 31, 2015 at 5:37 PM, Serena wrote: > I understand what you say, when I started working with Django I thought > exactly the same, it is more convenient that the date is saved with a time > zone and then the conversions are made, and also knew that the gap was > precisely because those 4

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread Serena
I understand what you say, when I started working with Django I thought exactly the same, it is more convenient that the date is saved with a time zone and then the conversions are made, and also knew that the gap was precisely because those 4:30 in my timezone, but the problem is not to show t

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread James Schneider
On Aug 31, 2015 2:58 PM, "Serena" wrote: > > No doubt that django is acting correctly. I understand what you tell me about it, then I know I can do conversions to the date shown in the templates have my time zone, but it is not what I want. Because when I do queries on bills for closing Z does not

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread Serena
No doubt that django is acting correctly. I understand what you tell me about it, then I know I can do conversions to the date shown in the templates have my time zone, but it is not what I want. Because when I do queries on bills for closing Z does not work, even when I have to close and tell

Re: TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread James Schneider
> Hello is the first time I write on the list, I have little time learning > Django and presented me a drawback. I have a model called Bill, which has a > field called date of sale, and I need to store the date and time of the sale > but the client time, and now it is keeping the server time. As I

TIME ZONE DJANGO SAVE DATETIMEFIELD

2015-08-31 Thread Serena
Hello is the first time I write on the list, I have little time learning Django and presented me a drawback. I have a model called Bill, which has a field called date of sale, and I need to store the date and time of the sale but the client time, and now it is keeping the server time. As I keep

Re: filter Datetimefield

2014-12-22 Thread Jan Duzinkiewicz
It's hard to answer without seeing what's in your db, and what are the values of ano/mes/dia variables, but: - maybe you do not have pytz package installed (you can install with 'pip install pytz') - though in that case you should get an error when trying to access the results - maybe the day

Re: filter Datetimefield

2014-12-21 Thread Rafael Borella
I figured out what did happen... i just needed to put midnight on timefield and it worked Thks for help!! -- 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 d

Re: filter Datetimefield

2014-12-21 Thread Vijay Khemlani
When you print the SQL query that is executed on the database print lista_de_balada.query Does it make sense? When you see the actual value stored in the database is it stored correctly? Also remember that the month and day are 1-based (january is 1, february is 2, etc) Suerte! :D On Sun, D

filter Datetimefield

2014-12-21 Thread Rafael Borella
Hi, i'm new in django and python, I'm trying to create a queryset to filter according to date. this is my MODEL : data = models.DateTimeField() and my VIEW:def resultado(request, dia, mes, ano): lista_de_balada= Balada.objects.filter(data__year=ano, data__mo

Re: DateTimeField: Hide clock

2014-10-23 Thread Oskar Lyrstrand
Thank you very much for that point! :D I am fairly new to Django and Python, just followed the official doc for making an app and these kinds of things aren't obvious for me. To make it more clear: I changed from DateTimeField to DateField and updated my browser.. (nothing).., I actually h

Re: DateTimeField: Hide clock

2014-10-23 Thread Daniel Roseman
9:25" to show. What can I do? > Why are you using DateTimeField if you don't want the time? Why not just use DateField? -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

Re: DateTimeField: Hide clock

2014-10-23 Thread jirka . vejrazka
Look at the "date" filter in template documentation, allows you to customize the output. HTH Jirka -Original Message- From: Oskar Lyrstrand Sender: django-users@googlegroups.com Date: Thu, 23 Oct 2014 03:28:10 To: Reply-To: django-users@googlegroups.com Subject: Dat

DateTimeField: Hide clock

2014-10-23 Thread Oskar Lyrstrand
models.py: class Post(models.Model): pub_date = models.DateTimeField template.html: {{ post.pub_date }} output: 23 october 2014 19:25 Problem is I dont want "19:25" to show. What can I do? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Django migrations and DateTimeField defaults

2014-08-13 Thread Andy Roxby
Thanks, that's what I did. In my humble opinion, the ValueError should be removed and the timezone serialized in the form UTC offset (eg: -0400). On Tuesday, August 12, 2014 9:43:11 PM UTC-4, Collin Anderson wrote: > > Wow. That almost sounds like a bug, though you can however use a callable. >

Re: Django migrations and DateTimeField defaults

2014-08-12 Thread Collin Anderson
Wow. That almost sounds like a bug, though you can however use a callable. As ridiculous as it looks, it should work :). INF_TIME = datetime.max.replace(tzinfo=timezone.utc) def get_inf_time(): return INF_TIME death = models.DateTimeField(default=get_inf_time) What you are doing seems pret

Django migrations and DateTimeField defaults

2014-08-12 Thread Andy Roxby
Hello all, I'm new to this list so please let me know I'm overlooking any sort of e tiquette. I'm having problem trying to use a default value for a DateTimeField. When I specify a default value WITH a timezone I receive the following error during './manage.py makemig

Re: Why are DateTimeField auto_now and auto_now_add bad?

2014-07-31 Thread cmawebsite
It gets confusing if those fields are editable in the admin. I recommend setting editable=False on those fields. On Sunday, July 27, 2014 6:47:33 PM UTC-4, Russell Keith-Magee wrote: > > > I'm not aware of a formally documented list anywhere. > > To the best my knowledge, the bug/downside that i

Re: Why are DateTimeField auto_now and auto_now_add bad?

2014-07-27 Thread Russell Keith-Magee
I'm not aware of a formally documented list anywhere. To the best my knowledge, the bug/downside that is referred to here is that the fields *won't* automatically update in *every* circumstance. You need to actually *save* the model to make the field update. Calls to update, save_base, etc won't i

Why are DateTimeField auto_now and auto_now_add bad?

2014-07-27 Thread Mattias Linnap
Hi all, I've seen DateTimeField's auto_now and auto_now_add parameters often described as "buggy" or "error-prone". For example: https://code.djangoproject.com/ticket/22995 https://groups.google.com/forum/#!topic/django-developers/TNYxwiXLTlI The ticket proposes to document these downsides or pr

Migration failure in 1.7c1 on DateTimeField defaults

2014-07-24 Thread dolsen
I have created two new fields on my model. Created and updated. They are both DateTimeField objects. When I run makemigrations it asks for a fix because there is no default value for the two fields. I have tried datetime.now(), datetime.datetime.now(), datetime.date.today(), etc. However, I

Re: RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-12 Thread Tom Evans
; tarefa.save() > > Terminal: > > RuntimeWarning: DateTimeField Task.start received a naive datetime > (2014-07-21 07:39:14) while time zone support is active. > > RuntimeWarning) > > > What is it? Any solution? > Somewhere you are producing a naive datetime

Re: RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-10 Thread Mike Dewhirst
On 11/07/2014 1:44 PM, Neto wrote: Hi guys, I need a help here: *settings.py* TIME_ZONE = 'America/Sao_Paulo' *view.py:* task = Task.objects.get(id=id) task.start = request.GET['task_start'] tarefa.save() Terminal: RuntimeWarning: Date

RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-10 Thread Neto
Hi guys, I need a help here: *settings.py* TIME_ZONE = 'America/Sao_Paulo' *view.py:* task = Task.objects.get(id=id) task.start = request.GET['task_start'] tarefa.save() Terminal: RuntimeWarning: DateTimeField Task.start received a naive date

Re: DateTimeField always returns None

2014-07-08 Thread William Granli
> Yours, > Russ Magee %-) > > > > > On Sun, Jul 6, 2014 at 10:51 AM, Dean > > wrote: > >> I think there is a restriction in using 'date' in MySQL as a field name >> as it's some sort of inbuilt function. >> >> On Friday,

Re: DateTimeField always returns None

2014-07-06 Thread Russell Keith-Magee
feature to add. Yours, Russ Magee %-) On Sun, Jul 6, 2014 at 10:51 AM, Dean wrote: > I think there is a restriction in using 'date' in MySQL as a field name as > it's some sort of inbuilt function. > > On Friday, July 4, 2014 5:01:15 PM UTC+8, William Granli wrote:

Re: DateTimeField always returns None

2014-07-05 Thread Dean
I think there is a restriction in using 'date' in MySQL as a field name as it's some sort of inbuilt function. On Friday, July 4, 2014 5:01:15 PM UTC+8, William Granli wrote: > > I am trying to create a queryset for getting the values of a DateTimeField > which is DAT

Re: DateTimeField always returns None

2014-07-04 Thread Tom Evans
On Fri, Jul 4, 2014 at 10:01 AM, William Granli wrote: > I am trying to create a queryset for getting the values of a DateTimeField > which is DATETIME in the DB. > > The class in models.py: > > class ChangeMetrics(models.Model): > id = models.IntegerField(primary_ke

Re: DateTimeField always returns None

2014-07-04 Thread trustedbox
Are you sure you're using the same DB ? Test it by adding new record and instantly retrieve it. пятница, 4 июля 2014 г., 12:01:15 UTC+3 пользователь William Granli написал: > > I am trying to create a queryset for getting the values of a DateTimeField > which is DATETIME in the DB.

DateTimeField always returns None

2014-07-04 Thread William Granli
I am trying to create a queryset for getting the values of a DateTimeField which is DATETIME in the DB. The class in models.py: class ChangeMetrics(models.Model): id = models.IntegerField(primary_key=True) file_id = models.ForeignKey(File, db_column = 'file_id')

DateTimeField returns an hour

2013-06-27 Thread Hélio Miranda
Hi! I have a problem and do not know what's wrong. I have a field defined with time DateTimeField ... When I insert eg 20:30 19:30 he returns, returns with an hour ... Someone can explain me why? thank you -- You received this message because you are subscribed to the Google Groups &q

Re: Date from DateTimeField vs date from model method: foreign key DateTimeField

2013-04-16 Thread Mike Doroshenko II
Gabriel [SGT] wrote: On Fri, Apr 12, 2013 at 2:47 PM, Mike Doroshenko II wrote: In my attached models.py Please, don't attach code, use a paste service or similar to view the code online. Ok, yeah I suppose that would save storage space and bandwidth considering the fact I have a few copied

Re: Date from DateTimeField vs date from model method: foreign key DateTimeField

2013-04-16 Thread Gabriel [SGT]
On Fri, Apr 12, 2013 at 2:47 PM, Mike Doroshenko II wrote: > In my attached models.py Please, don't attach code, use a paste service or similar to view the code online. > the time last modified on the latest object that has a foreign key to it. > > So when I made a new document, in the admin int

Re: Date from DateTimeField vs date from model method: foreign key DateTimeField

2013-04-16 Thread Mike Doroshenko II
Hello? Mike Doroshenko II wrote: In my attached models.py I have a class that has a model method to return the time last modified on the latest object that has a foreign key to it. So when I made a new document, in the admin interface I see April 11, 2013, 8:24 p.m. for the Created column an

Date from DateTimeField vs date from model method: foreign key DateTimeField

2013-04-12 Thread Mike Doroshenko II
In my attached models.py I have a class that has a model method to return the time last modified on the latest object that has a foreign key to it. So when I made a new document, in the admin interface I see April 11, 2013, 8:24 p.m. for the Created column and 2013-04-11 20:24:36.799167 for t

Re: DateTimeField stored as None

2013-02-03 Thread Rootz
shell to save/update a datetimefield value of > my model and then after querying the record it return None for > datetimefield column. > > Secondly my method was_published_recently() does not work. > > I am guessing maybe its because I am using sqlite3 correct me if I am > wr

DateTimeField stored as None

2013-02-03 Thread Rootz
I made several attempts to store/update the current date in a model. I used both admin page and the shell to save/update a datetimefield value of my model and then after querying the record it return None for datetimefield column. Secondly my method was_published_recently() does not work. I

Re: DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Iñigo Medina
On Fri, Jan 11, 2013 at 12:23:17AM -0800, Jeff Hsu wrote: > Hi all, > >I kept getting DateTimeField received a naive datetime (2013-01-10 > 00:00:00) while time zone support is active. but I can't figure out where > it's receiving a naive datetime. I have

Re: DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Tom Evans
On Fri, Jan 11, 2013 at 8:23 AM, Jeff Hsu wrote: > Hi all, > >I kept getting DateTimeField received a naive datetime (2013-01-10 > 00:00:00) while time zone support is active. but I can't figure out where > it's receiving a naive datetime. I have USE_TZ set to

DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Jeff Hsu
Hi all, I kept getting DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active. but I can't figure out where it's receiving a naive datetime. I have USE_TZ set to True in my setting file(stores timezone aware object in mysql?). My

Re: DateTimeField(auto_now_add=True) and admin page

2012-12-22 Thread arthur_mwai
Readonly doesn't offer flexibility at all sadly. @ DC,i have been experiencing the same problem,but funny thing is other projects prior to this one displayed DateTimeField() on the admin just fine. On Sunday, 11 December 2011 01:53:55 UTC+3, DC wrote: > > Hello Amit, > > Yes,

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-18 Thread bobhaugen
Tom, thank you for that very useful tip! My feeble python-fu has now been strengthened. On Monday, December 17, 2012 8:27:28 AM UTC-6, Tom Evans wrote > > > Following the thread I see that you have figured out where and why > this is coming from. There is a simple tip you can use to speed this

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-17 Thread Tom Evans
On Fri, Dec 14, 2012 at 5:46 PM, bobhaugen wrote: > RuntimeWarning: DateTimeField received a naive datetime (2012-12-14 > 17:39:38.878379) while time zone support is active. > > This is happening in my tests, but not in normal code. > > From dropping a trace in, it looks li

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-16 Thread Chris Cogdon
Awesome. Thanks for the update. On Sunday, December 16, 2012 3:56:22 AM UTC-8, bobhaugen wrote: > > Wrapping this up: the problem was caused by South, happened in migrate > (found via stack trace). When I upgraded South, the problem went away. -- You received this message because you are subs

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-16 Thread bobhaugen
Wrapping this up: the problem was caused by South, happened in migrate (found via stack trace). When I upgraded South, the problem went away. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://gr

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
Ok, got a friend to try this using python2.7 and did not get the naive datetime warnings. So I conclude it is something about either python2.6 or something else in my local environment, and not a proper django-users concern. P.S. Chris, thanks again for all the help. You're really active respond

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
On Sat, Dec 15, 2012 at 1:16 AM, Chris Cogdon wrote: > I never got the warnings you got, but I got three errors along the lines of: > IntegrityError: valueaccounting_economicagent.created_date may not be NULL > Want me to grab a different revision from git ? Fixed that one. You could do a git p

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Well, I did all that (and I learned a few things in the process that will be useful for my own project... thank you!) I never got the warnings you got, but I got three errors along the lines of: == ERROR: test_mismatched_agents1

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
Also, I recognize this is way beyond the call of duty, but if you really want to reproduce the problem, you might need to follow: https://github.com/valnet/valuenetwork/blob/master/docs/install.txt On Fri, Dec 14, 2012 at 7:06 PM, Chris Cogdon wrote: > Checked out the code and attempted to run "m

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
I'm running ./manage.py test valueaccounting -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Checked out the code and attempted to run "manage.py test", but clearly I don't have all the required modules installed. Sure is a lot of them! Are you running tests using "manage.py test" ?? If so, have you considered that its not _your_ code that is showing up those errors, but that of one o

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 6:07 PM, Chris Cogdon wrote: > Throw the code up somewhere I can see the results for myself? https://github.com/valnet/valuenetwork/blob/master/valuenetwork/valueaccounting/tests.py -- You received this message because you are subscribed to the Google Groups "Django use

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Throw the code up somewhere I can see the results for myself? On Friday, December 14, 2012 3:52:11 PM UTC-8, bobhaugen wrote: > > But sincerely, Chris, thanks for hanging in there on this. I baffled. > > On Fri, Dec 14, 2012 at 5:51 PM, Bob Haugen > > wrote: > > On Fri, Dec 14, 2012 at 5:42 PM

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
But sincerely, Chris, thanks for hanging in there on this. I baffled. On Fri, Dec 14, 2012 at 5:51 PM, Bob Haugen wrote: > On Fri, Dec 14, 2012 at 5:42 PM, Chris Cogdon wrote: >> Okay, so when you create your datetimes, are you defining them with a >> timezone ? > > I tried that; did not make a

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 5:42 PM, Chris Cogdon wrote: > Okay, so when you create your datetimes, are you defining them with a > timezone ? I tried that; did not make any difference. The error messages came up before any of the test setup code ran. (I put a pdb trace in at the start; the error me

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Okay, so when you create your datetimes, are you defining them with a timezone ? On Friday, December 14, 2012 1:05:19 PM UTC-8, bobhaugen wrote: > > On Fri, Dec 14, 2012 at 3:02 PM, Chris Cogdon > > wrote: > > Nothing definitive, but from checking the location of the code that is > > raising t

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 3:02 PM, Chris Cogdon wrote: > Nothing definitive, but from checking the location of the code that is > raising the warning, I suspect one of the following: > > 1. USE_TZ is not set in your production code, but _is_ set in your settings > file for your tests. Of course, you

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
thon2.6/site-packages/django/db/models/fields/__init__.py:808: > > RuntimeWarning: DateTimeField received a naive datetime (2012-12-14 > 19:41:27.469600) while time zone support is active. > RuntimeWarning) > /home/bob/.virtualenvs/vn2/lib/python2.6/site-packages/django/db/models/fields/_

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread bobhaugen
Creating test database for alias 'default'... > /home/bob/.virtualenvs/vn2/lib/python2.6/site-packages/django/db/models/fields/__init__.py:808: > > RuntimeWarning: DateTimeField received a naive datetime (2012-12-14 > 19:41:27.469600) while time zone support is active. > R

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread bobhaugen
other information. > > It's in a test. No real traceback, just a bunch of the same error messages: ./manage.py test valueaccounting Creating test database for alias 'default'... /home/bob/.virtualenvs/vn2/lib/python2.6/site-packages/django/db/models/fields/__init__.py:808: Ru

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Chris Cogdon
Would be nice to know what function's raising that error, and where the value came from. Requesting traceback, database type (tried it with more than one database type), and other information. On Friday, December 14, 2012 9:46:33 AM UTC-8, bobhaugen wrote: > > RuntimeWarning: Da

getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread bobhaugen
RuntimeWarning: DateTimeField received a naive datetime (2012-12-14 17:39:38.878379) while time zone support is active. This is happening in my tests, but not in normal code. >From dropping a trace in, it looks like it is happening before the test setup even runs. I double-checked my mod

Strange behaviour when adding negative timedelta to mysql backed DateTimeField

2012-12-02 Thread Oleksiy Pikalo
I got this weird behavior, specific to mysql backend, and specific to adding a negative timedelta to DateTimeField. Full stackoverflow question<http://stackoverflow.com/questions/13613907/adding-negative-timedelta-to-datetimefield-with-mysql-backend> I currently have a workaround w

Re: RuntimeWarning "DateTimeField received a naive datetime" with TIMESTAMP MySQL field

2012-11-19 Thread Tom Evans
or use with TZ aware datetimes. If the TZ itself isn't important, but keeping it as a TIMESTAMP is (presumably for auto updating?), I would subclass DateTimeField so that it 'fixes up' non aware datetimes as extracted from the DB to UTC. Cheers Tom -- You received this message bec

Re: RuntimeWarning "DateTimeField received a naive datetime" with TIMESTAMP MySQL field

2012-11-19 Thread Tom Evans
determine where the naive time is coming from is to turn the Warning into a RuntimeWarning, so that as soon as it happens Django will explode and you will get a lovely traceback showing precisely where it was created. Add this to your settings.py: import warnings warnings.filte

Re: RuntimeWarning "DateTimeField received a naive datetime" with TIMESTAMP MySQL field

2012-11-16 Thread Sencha
Yes I'm aware of this, however I'm not generating the datetime objects, it's all coming from Django (hence me wondering whether or not it's a bug or not). All I need to do to replicate the bug is get the object from the db and then save is straight away; then warning appears. Django abstracts a

Re: RuntimeWarning "DateTimeField received a naive datetime" with TIMESTAMP MySQL field

2012-11-16 Thread Timster
It's well-documented. Check out the Django documentation page on time zones: https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/ When time zone support is enabled, Django uses time-zone-aware datetime objects. If your code creates datetime objects, they should be aware too. In this mod

RuntimeWarning "DateTimeField received a naive datetime" with TIMESTAMP MySQL field

2012-11-16 Thread Sencha
as a `DateTimeField`. The data is already populated in this example. When the data is loaded into the model by Django, I can see in the `DateTimeField`'s `get_prep_value` method that the `DATETIME` field value come through as: datetime.datetime(2012, 11, 16, 16, 9, 25, tzinfo=) and the `TIMEST

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

2012-08-16 Thread Lachlan Musicman
Grimmus, You haven't really given us a lot of information to work with. My suggestion is: 1. Try it in another browser or clear your cache and try again 2. Send some more information, by (for example) using a code inspector (show source, firebug, etc) to see if the jquery and template code is in

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 to the Goo

Re: Getting the last modified datetime from a DateTimeField

2012-06-21 Thread Jesus Noland
I was always getting the date when the model was last modified when using 'm.date' On Thursday, June 21, 2012 2:35:02 PM UTC-7, Jesus Noland wrote: > > Thank you very much. I am understand now. Sorry it took so long to reply > back. > -- You received this message because you are subscribed to

Re: Getting the last modified datetime from a DateTimeField

2012-06-21 Thread Jesus Noland
Thank you very much. I am understand now. Sorry it took so long to reply back. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/7l1BiweMkwUJ. To post to thi

Re: Getting the last modified datetime from a DateTimeField

2012-06-06 Thread Derek
Please read: http://stackoverflow.com/questions/1737017/django-auto-now-and-auto-now-add On Jun 7, 8:14 am, Jesus Noland wrote: > Thank you for your reply. > > Ok so if I type out: > > m = Model.objects.get(id=1) > > then > > m.date > > Will give me the date and time of the last time it was save

Re: Getting the last modified datetime from a DateTimeField

2012-06-06 Thread Jesus Noland
Thank you for your reply. Ok so if I type out: m = Model.objects.get(id=1) then m.date Will give me the date and time of the last time it was saved? Because that is not what I am seeing. I am seeing the date the model was first created. On Tuesday, June 5, 2012 12:33:36 PM UTC-7, Jesus Nolan

  1   2   3   >