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:

Re: Local thread variable (attempting to create a connection pool)

2012-12-14 Thread Russell Keith-Magee
Can a thread local work? Yes. Are they a good idea? IMHO - Generally speaking, no. >From a purely architectural point of view, it doesn't matter what you call them -- you're talking about a global variable. Any argument that holds for why global variables are bad also holds for thread locals.

Re: Local thread variable (attempting to create a connection pool)

2012-12-14 Thread Rafael Almeida
I'm not sure it's really a singleton that I need because I need a different value for each thread. I'm using threading.local for it, so far I haven't run into any issues, but I'd like to hear the opinion of a more experienced django developer. I save in cache the possible IPs of the backend

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

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

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

Re: Model's optional __unicode__() return values?

2012-12-14 Thread Micky Hulse
Hi Chris! Thanks so much for your quick reply, I really appreciate it. On Fri, Dec 14, 2012 at 3:41 PM, Chris Cogdon wrote: > oops... that should be "if x is not None", not "where x is not None"... > Clearly I am still half in SQL mode :) Sweet!!! Works perfectly: return ' |

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

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

Re: Modelform and Ajax (Select a valid choice..... Error)

2012-12-14 Thread Chris Cogdon
Good... but we'd all appreciate knowing what was wrong, so we can guide others :) On Thursday, December 13, 2012 9:05:44 PM UTC-8, siddharth56660 wrote: > > Hey Chris > > Thanks for the replybut i figured it out what was wrong. > :) > -Siddharth > On Thu, Dec 13, 2012 at 6:09 PM, Chris

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 >>

Re: Helptext forms forms

2012-12-14 Thread Chris Cogdon
"Support": sure! I won't "do the work" for you though :) Okay, Just reading through the django code, and I'm seeing that the help_text is _not_ emitted in the field's widget, but in the _html_output method of BaseForm In other words, you don't need to update the widget. Useless doing so. So,

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

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

Re: Model's optional __unicode__() return values?

2012-12-14 Thread Chris Cogdon
oops... that should be "if x is not None", not "where x is not None"... Clearly I am still half in SQL mode :) On Friday, December 14, 2012 3:41:01 PM UTC-8, Chris Cogdon wrote: > > The pattern I use is ", ".join ( [ unicode(x) for x in ( thing_a, thing_b, >

Re: Model's optional __unicode__() return values?

2012-12-14 Thread Chris Cogdon
The pattern I use is ", ".join ( [ unicode(x) for x in ( thing_a, thing_b, getattr(obj,"optional_attribute",None ), ...etc... ) where x is not None ] ) On Friday, December 14, 2012 2:49:16 PM UTC-8, mhulse wrote: > > Hello, > > This is probably a dumb question, but... > > What's the best way

Model's optional __unicode__() return values?

2012-12-14 Thread Micky Hulse
Hello, This is probably a dumb question, but... What's the best way to handle optional __unicode__() return values? In this situation, I'm wanting to return the __unicode__ values from other models. I've found myself doing a lot of this: def __unicode__(self): return _(u'%s%s%s') %

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

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

2012-12-14 Thread Chris Cogdon
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, your code should work either way for the most flexibility. 2.

Re: Helptext forms forms

2012-12-14 Thread 4 The good Life we work
Hallo Chris, thank you for the good explanation. I'm then afread that I have to create my own widget for this. Can you support me on this? Thanks, Tony Michael On Fri 14 Dec 2012 08:45:40 PM CET, Chris Cogdon wrote: > If you're designing your own HTML (eg: this is not in the admin) then >

Re: Send out E-mail at given time

2012-12-14 Thread 4 The good Life we work
Hi William, thanks :). I'll look at celery. Thanks, Michael On 12/14/2012 04:08 PM, william ratcliff wrote: > Welcome aboard! Please check out django-celery. I believe it will > solve your problem for doing an activity at a specified time. > > Good luck! > > > On Fri, Dec 14, 2012 at 8:37

Re: Send out E-mail at given time

2012-12-14 Thread 4 The good Life we work
Hallo Javier, this sound good. I'll try this. Thank you, Michael On Fri 14 Dec 2012 07:58:26 PM CET, Javier Guerra Giraldez wrote: > On Fri, Dec 14, 2012 at 8:37 AM, 4 The good Life we work > <4thegdl...@googlemail.com> wrote: >> Let's say I've choosen the 15th Dez 2012 as reminder date. >>

Re: validation error in Django Admin

2012-12-14 Thread Chris Cogdon
Thanks for the follow up! On Wednesday, December 12, 2012 4:21:59 PM UTC-8, Mike Dewhirst wrote: > > I'm getting an unexpected validation error in Admin which baffles me. > Any hints appreciated ... here is the traceback > > http://dpaste.com/844972/ > > At the bottom of the traceback where

Re: Helptext forms forms

2012-12-14 Thread Chris Cogdon
If you're designing your own HTML (eg: this is not in the admin) then there's nothing stopping you rendering the help text any way you want. Eg: {{ form.field1 }} (that might not exactly work as written, but using it to give you the gist of things... my preference would be to put the text

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

2012-12-14 Thread bobhaugen
Oh, and Django 1.4.1...sorry. On Friday, December 14, 2012 1:43:09 PM UTC-6, bobhaugen wrote: > > Thanks for the reply. > > On Friday, December 14, 2012 1:27:03 PM UTC-6, Chris Cogdon wrote: >> >> Would be nice to know what function's raising that error, and where the >> value came from.

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

2012-12-14 Thread bobhaugen
Thanks for the reply. On Friday, December 14, 2012 1:27:03 PM UTC-6, Chris Cogdon wrote: > > 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. > >

Re: Local thread variable (attempting to create a connection pool)

2012-12-14 Thread Chris Cogdon
What you essentially want is a common pattern called a "singleton": something that there is only one of, like "None" and "Elipsis". You can do something workable, but ugly, using module-level variables, but there are known patterns for creating singletons Here's some starters:

Re: GeoDjango annotate distance

2012-12-14 Thread Chris Cogdon
Just did a cursory read of the geodjango documentation for the first time...the querysets being returned from "all()" (or really, just objects) need to be GeoQuerySets which have a default "position" as part of their specification (I think), also such modules need to inherit from the geo

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: DateTimeField

Re: Send out E-mail at given time

2012-12-14 Thread Javier Guerra Giraldez
On Fri, Dec 14, 2012 at 8:37 AM, 4 The good Life we work <4thegdl...@googlemail.com> wrote: > Let's say I've choosen the 15th Dez 2012 as reminder date. > Then by 1AM the system should send out an E-mail to the user. E-mail is > saved under user-data. - create a 'custom management command'

Re: How Alter Table to add foreign key to Django Models

2012-12-14 Thread Javier Guerra Giraldez
On Thu, Dec 13, 2012 at 7:53 AM, laxglx wrote: > Can anybody plz tell me how to add a foreign key an existing table using SQL > Queries? >>> I got the command, nut can't understand > > ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) > REFERENCES addresses

Re: Django Celery FIFO ORDER

2012-12-14 Thread Nikolas Stevenson-Molnar
Ok, how about this: instead of sending the POST data as part of your Celery task, serialize the data to your DB with an auto-increment id (which is default for Django model ids), then have he celery task grab the data from the database, sorted by asc id. Then you'll always be processing the data

Local thread variable (attempting to create a connection pool)

2012-12-14 Thread Rafael Almeida
Hello, I have a django application which needs to connect to some backend services. Problem is I don't want to create a new connection everytime, but to use a connection pool. One connection per thread would be fine, but I don't know how to use django in order to achive that. I'd like to

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 models,

Re: Weird problem in common_settings include

2012-12-14 Thread Bill Freeman
On Fri, Dec 14, 2012 at 8:39 AM, florian wrote: > > > On Friday, December 14, 2012 11:17:07 AM UTC+1, ke1g wrote: >> >> >> How are you combining INSTALLED_APPS from the two files? Note that >> simply "setting" it to what you want to add in the file that includes the >>

Re: [ANNOUNCE] Security releases (Django 1.3.5, Django 1.4.3, Django 1.5 beta 2)

2012-12-14 Thread victoria
On Mon, Dec 10, 2012 at 11:38 PM, James Bennett wrote: > Django 1.3.5, Django 1.4.3 and Django 1.5 beta 2 have just been issued > in response to security issues. > > Details are available here: > > https://www.djangoproject.com/weblog/2012/dec/10/security/ > It has taken a

Re: Question on Multiple Database Connections

2012-12-14 Thread Matt Woodward
On Thursday, December 13, 2012 8:01:13 AM UTC-8, ke1g wrote: > > > Just a shot in the dark: Maybe if, since you're not using the ORM on the > 'other' database, you shouldn't use django-pyodbc, but rather just pyobdc. > I should have said this earlier but I had the same thought and tried doing

Re: AttributeError on _strptime_time

2012-12-14 Thread code2live
http://bugs.python.org/issue7980 http://bugs.python.org/issue11108 On Tuesday, September 25, 2012 1:39:53 PM UTC-4, Victor wrote: > MadeR did you ever get to the bottom of this error? I am using > python2.6.5, django1.3.1, and tastypie0.9.7 with a mysql5.1 back end. Its a > real doozy, I have

Re: Implementing a monitoring system with django.

2012-12-14 Thread Marc Aymerich
On Wed, Dec 12, 2012 at 12:23 PM, Tom Evans wrote: > On Mon, Dec 10, 2012 at 7:41 PM, Marc Aymerich wrote: >> Hi, >> I'm considering to implement a simple monitorization system that >> basically gathers some data from a set of nodes (<1000 nodes).

Best way to distribute a "standalone django application" ?

2012-12-14 Thread Chris Cogdon
I've been developing an art show management application (in both the general and Django senses) for the past few years, and have had it up on sourceforge and github for a while. It's very close to being "complete" and I'd like to make sure its as useful as possible to as wide an audience.

Re: How Alter Table to add foreign key to Django Models

2012-12-14 Thread Chris Cogdon
It doesn't look like you're using Django at all. I suggest taking your question to the support community for the database you're using. On Thursday, December 13, 2012 4:53:25 AM UTC-8, laxglx wrote: > > Can anybody plz tell me how to add a foreign key an existing table using > SQL Queries? >

Send out E-mail at given time

2012-12-14 Thread 4 The good Life we work
Hallo, I'm building my first Django 1.4.2 Application with stores contract data. I would like to get a reminder E-mail when the set remainder date in the DB is reached. Let's say I've choosen the 15th Dez 2012 as reminder date. Then by 1AM the system should send out an E-mail to the user. E-mail

Re: How Alter Table to add foreign key to Django Models

2012-12-14 Thread Chris Cogdon
Are you sure you're using Django? This SQL statement does not look like something django would have emitted. Perhaps your query is best taken to the support community for the database you're using. Our advice here may not be relevant to you. The issue you're having is what the South package is

Re: Weird problem in common_settings include

2012-12-14 Thread florian
On Friday, December 14, 2012 11:17:07 AM UTC+1, ke1g wrote: > > > How are you combining INSTALLED_APPS from the two files? Note that simply > "setting" it to what you want to add in the file that includes the other > *replaces* the value you have imported from the other. Be sure to use += >

Helptext forms forms

2012-12-14 Thread 4 The good Life we work
Hallo, I'm wondering if there is a better way to have helptext informs than help_text which is displayed under the form. Something like FIEDL ? while ? is a button I can click on and it displays the helptext. I'll welcome an example. Thanks, Tony -- You received this message because you are

Re: django-registration customization

2012-12-14 Thread sri
Hi Karen, Thanks very much for your help. It's working now after i used the registrationfrom in the template. Thanks On Friday, 14 December 2012 02:34:24 UTC, Karen Tracey wrote: > > On Wed, Dec 12, 2012 at 3:36 PM, sri >wrote: > >> Now, when i click on the register

Re: Error with unit testing with Raven.

2012-12-14 Thread xina towner
I've found the solution. The problem was that I was using the 'raven.contrib.django.middleware.Sentry404CatchMiddleware' so the Middleware was getting the 404 signals. I think that because of that the test were not receiving the signals so when in the test we were checking for 404 codes the tests

Re: Weird problem in common_settings include

2012-12-14 Thread Bill Freeman
On Thu, Dec 13, 2012 at 7:47 AM, florian iragne wrote: > Ok, i've get rid of my "special" mobile_manage.py and pass the --settings > option when i start the fcgi process (i use nginx+fcgi, no mod_wsgi). > > Using manage.py, with each settings file, i can verify that the >

Re: Django Celery FIFO ORDER

2012-12-14 Thread psychok7
Ok i am going to detail what i want to do a little further: So i have this django app, and when i press submit after i fill in the form my celery worker wakes up and takes care of taking that submitted data and posting to a remote server. This i can do without problems. Now, imagine that my