Re: ORM performance

2014-09-03 Thread Sithembewena Lloyd Dube
Thanks to the OP for asking this, and to all who answered. Ben, special stars to you - you just shared some very valuable insight into efficieint use of the ORM (wasn't obvious to me). Kind regards, Lloyd On Thu, Sep 4, 2014 at 2:21 AM, Benjamin Scherrey wrote: > The

Re: ORM performance

2014-09-03 Thread Benjamin Scherrey
The short answer to your question is no, the Django ORM is not inherently slower in that regard and it's very likely something you're doing. The useful answer is probably more complicated. :-) Naive usage of the ORM without an understanding of how it translates to SQL is likely to result in some

Re: ORM performance

2014-09-03 Thread Tom Lockhart
On 2014-09-03, at 4:22 PM, msoulier wrote: > Hi, > > I am looking at Django's performance with respect to modifying large numbers > of objects, each in a unique way that cannot be batched. If I make a simple > change to one of my Django models and save(), and then

ORM performance

2014-09-03 Thread msoulier
Hi, I am looking at Django's performance with respect to modifying large numbers of objects, each in a unique way that cannot be batched. If I make a simple change to one of my Django models and save(), and then do the same thing in sqlalchemy, I notice a performance difference of about 48

Re: Catching AttributeError exceptions in widget media

2014-09-03 Thread Collin Anderson
unfortunately hasattr eats even more exceptions than AttributeError. -- 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.

Re: static files

2014-09-03 Thread Collin Anderson
it should be relative do your /static/ directory like so: {% static "images/pilka.jpg" %} -- 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

How do I save an object under two different classes using the admin page

2014-09-03 Thread Alejandro Greppi
I have an application that has defined these models: class Manufacturer(models.Model): manufacturer = models.CharField(max_length=40, unique=True) def __str__(self): return self.manufacturer and class DeviceModel(models.Model): model = models.CharField(max_length=20,

Django custom RelatedManager with ManyToManyField for multi-record inheritance

2014-09-03 Thread Dr. Sultan Alotaibi
I have the following object structure: class Car(models.Model): name = models.CharField(max_length=16) class Person(models.Model): name = models.CharField(max_length=32) cars = models.ManyToManyField(Car, through='Relationship') parent = models.ForeignKey('self', null=True,

static files

2014-09-03 Thread Dariusz Mysior
I have my path like below: home > darmys > dom > player

Re: How create a custom permission for a model?

2014-09-03 Thread YusufSalahAdDin
Don't works for me :'( El lunes, 1 de septiembre de 2014 12:07:19 UTC-5, Collin Anderson escribió: > > > Can't create other users > > Can't create other topics or subtopics > These can be done using built in permissions and groups > > Something like this might work for the rest: > > class

Re: Does Django detect changes in models Meta ?

2014-09-03 Thread Collin Anderson
Well, it just came less than a day ago, so Google is probably still catching up :) -- 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

Re: [ANNOUNCE] Django 1.7 released

2014-09-03 Thread Thomas Leo
Keep up the great work! On Tuesday, September 2, 2014 6:13:21 PM UTC-4, James Bennett wrote: > > Django 1.7 is now available: > > https://www.djangoproject.com/weblog/2014/sep/02/release-17-final/ > > Alongside this are bugfix releases for 1.4, 1.5 and 1.6. The bugfix 1.5 > release is the final

Django testing hooks

2014-09-03 Thread Andreas Kuhne
Hi all, When running django tests (django 1.6) is it possible to run a specific command before the tests and run a command on failure and on success? I have bought a blink1 (http://blink1.thingm.com/) and would like it to change colour depending on the results of the tests. Is this possible?

Re: Does Django detect changes in models Meta ?

2014-09-03 Thread Norman Bird
Ok, I have version 1.6.5. I will see about updating. HmmmI had googled and this is the first im hearing of this. Got to love Django. :-) On Tuesday, September 2, 2014 5:40:52 PM UTC-4, Collin Anderson wrote: > > The newest version of django, version 1.7, has migrations built in. > -- You

Catching AttributeError exceptions in widget media

2014-09-03 Thread Michael Jones
Hi, I love Django, it has been enormously useful to a new comer to web dev like me. One minor issue I've just had is that I've struggled to figure out an issue with my code because an AttributeError I was generating in my media property on my custom widget was being silently swallowed by:

Re: Apache on Windows & multiple Django apps

2014-09-03 Thread Tom Evans
On Tue, Sep 2, 2014 at 3:28 PM, DJ-Tom wrote: > > > Am Dienstag, 2. September 2014 13:51:28 UTC+2 schrieb Tom Evans: > >> >> The most obvious and simple solution is to not use Windows. > > > lol - ever heard of the "box of pandora"? :-) > > My knowledge of Linux boxes is

Re: Apache on Windows & multiple Django apps

2014-09-03 Thread DJ-Tom
Hi Collin, unfortunately, changing this makes no difference at all. Thomas Am Dienstag, 2. September 2014 17:45:37 UTC+2 schrieb Collin Anderson: > > setdefault is what's causing your trouble. Change it to an explicit: > > os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings' > -- You

Re: i18n and overriding django.auth translations

2014-09-03 Thread paul . connell
Well, it's a real situation - I removed the django.admin app from settings.py and then my translations worked - it's a basic occlusion - the django.admin translations seem to be used before my own translations when django.admin is enabled and my application has strings like 'Password' in them.

Re: crispy forms two forms and context

2014-09-03 Thread James Schneider
You'll probably want to look at setting up a FormWizard to break up your workflow into steps (fill out some fields, click next to continue, etc.). Django handles the multi-step forms for you very nicely. https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/ I find wizards to

Re: runserver error

2014-09-03 Thread Swathi Rajanna
> > I added password_reset import to > /home/swathi/env/local/lib/python2.7/site-packages/django/utils/importlib.py > then I got this python manage.py runserver Traceback (most recent call last): File "manage.py", line 9, in from django.core.management import execute_from_command_line