Re: Performance when retrieving data from related models

2013-03-18 Thread Taras D
Hi Peter On 18 March 2013 16:35, Peter of the Norse wrote: > You’re over thinking this by a large margin. getTendersForContractor > should return a QuerySet. That way you can add things like .select_related > as necessary in the view. > > Also, I’m a bit worried about the fact you have a functio

Re: Changing User model

2013-03-18 Thread Sanjay Bhangar
Hey L, On Mon, Mar 18, 2013 at 9:13 AM, Lachlan Musicman wrote: > Hola, > > For a new project, I will be creating a separate Profile class for all > information about my Users that isn't covered by User. > > One thing I did want though, was to change the login username to the > email address. >

Re: Settings object has no attribute 'ROOT_URLCONF' while deploying using apache and mod_wsgi

2013-03-18 Thread Tom Evans
On Sun, Mar 17, 2013 at 9:20 AM, Navid Shaikh wrote: > Hi folks, > > (Before posting I searched in archive and the question is kind of similar to > thread [1].) > > I am getting error: > AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF' Hi Navid Can you show the structure of your

django notification like facebook

2013-03-18 Thread Randa Hisham
what is the best django app for executinng realtime notification -- Randa Hesham Software Developer Twitter:@ro0oraa FaceBook:Randa Hisham ٍ -- You received this message because you are subscribed to the Google Groups "Djan

Re: django notification like facebook

2013-03-18 Thread Thomas Weholt
On Mon, Mar 18, 2013 at 2:56 PM, Randa Hisham wrote: > what is the best django app for executinng realtime notification WebSockets or ajax polling? Don't know of any app for it though. Thomas > > -- > Randa Hesham > Software Developer > > Twitter:@ro0oraa > FaceBook:Randa Hisham > > ٍ > > -- >

Session values (occasionally) not being persisted

2013-03-18 Thread Philip Goh
Dear list, This is a question that was asked on Stackoverflow more than a week ago, but I haven't had an answer so I am posting this to the Django mailing list as well. http://stackoverflow.com/questions/15338103/django-session-values-occasionally-not-persisted

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Shawn Milochik
Do you have SESSION_SAVE_EVERY_REQUEST enabled? https://docs.djangoproject.com/en/1.4/topics/http/sessions/#session-save-every-request -- 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

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-18 Thread Felipe Coelho
> > 1) Using tests that need the models, but don't actually touch the > database. This means you can put the model definition inline in the test > code, so AUTH_USER_MODEL has the right value when the code is run. This > lets us test validation conditions, etc, but not hit the database. You > *mig

PostgresSQL or MySql with django?

2013-03-18 Thread frocco
Hello, What is the recommended database for django? I have used MySQL, but am interested in Postgres. Thanks -- 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: Session values (occasionally) not being persisted

2013-03-18 Thread Philip Goh
On Monday, 18 March 2013 15:11:10 UTC, Shawn Milochik wrote: > > Do you have SESSION_SAVE_EVERY_REQUEST enabled? > > > https://docs.djangoproject.com/en/1.4/topics/http/sessions/#session-save-every-request > > I currently do not have it enabled. I have tried enabling it and it did not make an

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Matthias Müller
Make a +1 for postgres. I like the licensemodel of PG more than the license model of Mysql. There's a big community behind (no big company) and there is only one version. Mysql confuses me with the different versions (MariaDB, MySQL..). Since PG has the Hot-Stream-Feature it became more and more us

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Tom Evans
On Mon, Mar 18, 2013 at 11:30 AM, Philip Goh wrote: > Dear list, > > This is a question that was asked on Stackoverflow more than a week ago, but > I haven't had an answer so I am posting this to the Django mailing list as > well. > http://stackoverflow.com/questions/15338103/django-session-values

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Philip Goh
They're much of a muchness. I've favoured Postgres because it seems more straightforward as there aren't multiple distributions and crucially multiple storage engines to worry about. In MySQL's favour, Amazon RDS makes it incredibly simple to set up a scalable and reliable database so bear that

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Shawn Milochik
Postgres. Just from conversations I've seen in the community, MySQL has a thousand edge-cases which cause problems. From previous conversations on thsi topic, I think more people use Postgres. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: PostgresSQL or MySql with django?

2013-03-18 Thread frocco
Thank you for your feedback. Other than the docs, is there a good ebook to learn the basics. I just purchased navicat to use. -- 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

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Lee Hinde
On Mar 18, 2013, at 9:34 AM, frocco wrote: > Thank you for your feedback. > Other than the docs, is there a good ebook to learn the basics. I just > purchased navicat to use. > https://django.2scoops.org/ -- You received this message because you are subscribed to the Google Groups "Djang

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Chris Streeter
I'd add to this that if you are interested in either running with an async worker like gevent or with Python 3 support, MySQL is a no-go. The main MySQL connector, MySQLdb, doesn't yet support Python 3; work is forthcoming in a branch, though no timeline is given. And if you want to have some sort

Re: PostgresSQL or MySql with django?

2013-03-18 Thread frocco
Thanks, I purchased this book, I was looking for postgresSQL tutorial On Monday, March 18, 2013 12:38:59 PM UTC-4, Lee Hinde wrote: > > > On Mar 18, 2013, at 9:34 AM, frocco > > wrote: > > > Thank you for your feedback. > > Other than the docs, is there a good ebook to learn the basics. I jus

Re: Settings object has no attribute 'ROOT_URLCONF' while deploying using apache and mod_wsgi

2013-03-18 Thread Navid Shaikh
On Sunday, March 17, 2013 7:49:31 PM UTC+5:30, JirkaV wrote: > > I'd look at how you reference your settings during imports. The error > message spells "Settings" with uppercase "S" which feels incorrect. > > Hi Jirka, I appreciate your response. This is default behavior (I am not sure whether t

Re: Settings object has no attribute 'ROOT_URLCONF' while deploying using apache and mod_wsgi

2013-03-18 Thread Navid Shaikh
On Monday, March 18, 2013 6:17:26 PM UTC+5:30, Tom Evans wrote: > > Hi Navid > > Can you show the structure of your project, where it is on disk and so > on. I suspect that in mysite.wsgi, you are inserting the wrong paths > into sys.path, and then Django cannot find your correct settings. >

Re: Changing User model

2013-03-18 Thread Lachlan Musicman
Sanjay! How are ya? I'll let you know as soon as I've properly implemented the whole shebang. Re "problems with admin" I just sent an email to pydanny of 2Scoops in this regard. I don't think it's clear enough anywhere, but careful reading of this: https://docs.djangoproject.com/en/1.5/topics/aut

Django 1.5 cached response has an empty body

2013-03-18 Thread SteveB
With the change to HttpResponse made in Django 1.5, I'm finding that in my code, which caches a generated response, results in an empty body when that page is requested a second time. The first time the page is requested, it is not in the cache, and the page is generated normally and added to th

Re: Changing User model

2013-03-18 Thread Sanjay Bhangar
On Tue, Mar 19, 2013 at 3:11 AM, Lachlan Musicman wrote: > Sanjay! > > How are ya? I'll let you know as soon as I've properly implemented the > whole shebang. Re "problems with admin" I just sent an email to > pydanny of 2Scoops in this regard. I don't think it's clear enough > anywhere, but caref

DATABASES is improperly configured. Please supply the ENGINE value - 2 databases

2013-03-18 Thread Andrew Taylor
Hi, I'm trying to get django to play with a pre-existing database "dbtransitcross". It was working until I attempted to add this second database. Any suggestions what to look at would be appreciated. Thanks, Andy PS project structure is: -Stringer/ manage.py Stringer/

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Russell Keith-Magee
On Tue, Mar 19, 2013 at 12:07 AM, Philip Goh wrote: > They're much of a muchness. I've favoured Postgres because it seems more > straightforward as there aren't multiple distributions and crucially > multiple storage engines to worry about. In MySQL's favour, Amazon RDS > makes it incredibly simpl

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Lachlan Musicman
On 19 March 2013 10:50, Russell Keith-Magee wrote: > On Tue, Mar 19, 2013 at 12:07 AM, Philip Goh >> In the end, if you're asking this question you can't go far wrong if you >> toss a coin and pick one. > > Much of a muchness? They *really* aren't. One of them is an actual database. > One of them

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Christophe Pettus
On Mar 18, 2013, at 4:50 PM, Russell Keith-Magee wrote: > Summary - if you issue a SELECT query that contains an "WHERE X IS NONE" > clause, and nothing matches the SELECT, and an object was inserted by the > last statement, the SELECT query returns *the primary key of the object that > was re

Re: Changing User model

2013-03-18 Thread Lachlan Musicman
On 18 March 2013 22:59, Sanjay Bhangar wrote: > Hey L, > > On Mon, Mar 18, 2013 at 9:13 AM, Lachlan Musicman wrote: >> Hola, >> >> For a new project, I will be creating a separate Profile class for all >> information about my Users that isn't covered by User. >> >> One thing I did want though, w

Re: Performance when retrieving data from related models

2013-03-18 Thread Peter of the Norse
More inline stuff. On Mar 18, 2013, at 4:14 AM, Taras D wrote: > Hi Peter > > On 18 March 2013 16:35, Peter of the Norse wrote: > You’re over thinking this by a large margin. getTendersForContractor should > return a QuerySet. That way you can add things like .select_related as > necessary i

NameError help

2013-03-18 Thread Nicklas af Ekenstam
Hello, I am working on a few models but keep getting "NameError: name 'Area' is not defined" while trying to validate. I must be doing something wrong but I seem to be unable to figure it out myself and any help would be very appreciated as I am now stuck on what I believe is a really trivial prob

Re: NameError help

2013-03-18 Thread Nicklas af Ekenstam
Never mind. Too tired to realize I had my model classes in the wrong order. On Tue, Mar 19, 2013 at 1:18 AM, Nicklas af Ekenstam wrote: > Hello, > > I am working on a few models but keep getting "NameError: name 'Area' > is not defined" while trying to validate. I must be doing something > wrong

How to get ten random records

2013-03-18 Thread Mike Dewhirst
No really, I want a maximum of ten random records from the database (Django 1.4, Postgres 9.1). Looking at the docs this seems to be what I want ... Items.objects.filter(name__icontains=term).order_by('?')[:10] Is there a better way? Would .order_by() be quicker if I wasn't too concerned

Re: How to get ten random records

2013-03-18 Thread Christophe Pettus
On Mar 18, 2013, at 9:03 PM, Mike Dewhirst wrote: > No really, I want a maximum of ten random records from the database (Django > 1.4, Postgres 9.1). This is a case where the raw SQL interface might be the right answer: you can just tack an ORDER BY random() clause onto the query. -- -- Chris

Re: How to get ten random records

2013-03-18 Thread Mike Dewhirst
On 19/03/2013 3:29pm, Christophe Pettus wrote: On Mar 18, 2013, at 9:03 PM, Mike Dewhirst wrote: No really, I want a maximum of ten random records from the database (Django 1.4, Postgres 9.1). This is a case where the raw SQL interface might be the right answer: you can just tack an ORDER BY