Re: Norwegian Sorting

2011-09-09 Thread Иван Иванов
На Fri, 09 Sep 2011 22:18:50 +0100 Tim Sawyer написа: > Hi Folks, > > I have a django site which is against a postgres database which is > UTF8. I have a large droplist with international names in, and it > doesn't appear to be sorting correctly. > > The list

Re: new at this -- need some guidance

2011-09-09 Thread Babatunde Akinyanmi
The problem is very clear. Add a related_name argument to those fields in your model. If you are not sure how to do this, search the documentation for "related_name" On 9/10/11, Danny Gale wrote: > Hi, I'm learning Django (albeit slowly) and I'm trying to set up a really

Re: newbie question on activating the automatic admin

2011-09-09 Thread Babatunde Akinyanmi
Hi nara, This error is normally thrown when the sites app is being used in a django project. I think it can also occur if the sites tables in the database is not properly created during django-admin startproject. Someone else reported that he was able to solve the problem by using a user name

new at this -- need some guidance

2011-09-09 Thread Danny Gale
Hi, I'm learning Django (albeit slowly) and I'm trying to set up a really simple database. I want to have Artists, Albums, and Tracks. I want to be able to navigate both ways in the db. So you should be able to go from artist -> album or from album -> artist. Same thing with album and track. I

Re: newbie question on activating the automatic admin

2011-09-09 Thread nara
yes, admin is in INSTALLED_APPS. BTW, the basic site works fine if I turn off all admin. admin is not strictly necessary, it is just a nicety. One strange thing though: I have had to set PYTHONPATH and explicitly set it to ~/mblog:~/mblog/apps:~/mblog/apps/myblog, even though __init__.py files

[ANNOUNCE] Security releases issued

2011-09-09 Thread James Bennett
Today we've released Django 1.3.1 and Django 1.2.6 to deal with several security issues reported to us. Details of these issues and the releases, along with several important advisory notes, are available in the blog post on djangoproject.com:

Re: How to achieve a construction similar to clean_?

2011-09-09 Thread Matt Schinckel
You can find it in django.forms.forms.BaseForm._clean_fields (django/forms/forms.py line 271, the line you'll want to look at is 286). To solve your specific problem, you'll want to do something like: for field in self.model._meta.fields: if hasattr(self, "process_%s" % field.name):

Re: newbie question on activating the automatic admin

2011-09-09 Thread Casey Greene
Is admin in INSTALLED_APPS? https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTALLED_APPS Casey On 09/09/2011 07:04 PM, nara wrote: Hi, I am a newbie, and I am trying a very basic blog site to get familiar with the latest development release. I followed the directions in the

newbie question on activating the automatic admin

2011-09-09 Thread nara
Hi, I am a newbie, and I am trying a very basic blog site to get familiar with the latest development release. I followed the directions in the tutorial (part 2) to try and get the automatic admin going. However, here is what I get on the url localhost:8000/admin/ DoesNotExist at /admin/ Site

Re: Norwegian Sorting

2011-09-09 Thread Thomas Weholt
As a norwegian myself this is very interesting. I have no clue how to help you, but please post information about any solution you might encounter on your quest. Regards, Thomas On Fri, Sep 9, 2011 at 11:18 PM, Tim Sawyer wrote: > Hi Folks, > > I have a django site

Norwegian Sorting

2011-09-09 Thread Tim Sawyer
Hi Folks, I have a django site which is against a postgres database which is UTF8. I have a large droplist with international names in, and it doesn't appear to be sorting correctly. The list contains Ingvar Mæland and Børre Børresen. I'm told that the Norwegian sort order should be X Y Z

Re: Multitenant in Django

2011-09-09 Thread sjtirtha
But I cannot set the SITE_ID in the settings.py right? Because if one user set the SITE_ID = 1, then parallel another user can set the SITE_ID = 2. Because we only have one instance. On the other hand I still want to use SITE_ID from the settings.py, because using this I can call the models

How to achieve a construction similar to clean_?

2011-09-09 Thread Allan James Vestal
Hello, I'm creating a tool that will automate the downloading, processing and repackaging of data. The scripting for each data set is composed of two main parts: a fairly standard models.py file, and a loaders.py file that will contain all the instructions on how to turn the raw data into what

Complex queryset subquery where in

2011-09-09 Thread Mo J. Al-Mughrabi
Hi, I have been going in circles for hours and couldnt find help on stack overflow. Here is my question http://stackoverflow.com/questions/7365359/complex-query-in-django-where-subquery-exists Regards, Mo -- You received this message because you are subscribed to the Google Groups "Django

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
On Sep 9, 2011, at 9:44 AM, Pewpewarrows wrote: > I don't understand the 10-15 limit either. I've done giant "in" queries in > the past that perform fine with large data sets and proper indexing. You can set the rule of thumb whereever you like; eventually, the curves between an IN and a join

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
On Sep 9, 2011, at 8:41 AM, Simon Riggs wrote: > Not sure I understand the limitation to 10-15 entries. That's my rule of thumb as to when I prefer to re-express a query as a join rather than an IN. Larger values can work just fine, but __in in Django tends to be abused with gigantic

Re: Django queries with dates and __lte

2011-09-09 Thread Axel Bock
Indeed :) . I'd never have guessed that. Thanks, Axel. Am 08.09.2011 um 17:47 schrieb Shawn Milochik: > I think your order by needs to be "-start" instead of "start," then > take [0] instead of [:1]. That will get the newest entry that matches > your query. > > -- > You received this message

Re: Multitenant in Django

2011-09-09 Thread Eric Hutchinson
you could write a middleware that looks at the request.META and inserts the correct id into the request? you won't be able to access it like you would with the settings.SITE_ID, but it should be a start On Sep 9, 5:02 am, sjtirtha wrote: > Hi, > > I'm looking for the best

Re: Django on MediaTemple (dv) 4.0

2011-09-09 Thread Pewpewarrows
>From what I understand, MediaTemple's (dv) server is just a normal VPS that you would get from any other hosting company. Setup your environment and website how you would on any other production server. If you're asking about how to setup Django on a *nix server in general: look into

Django on MediaTemple (dv) 4.0

2011-09-09 Thread Katherine L
Hi everyone, I am having quite a bit of trouble finding current documentation on how to deploy Django to a 4.0 MediaTemple Dedicated server. The wiki page is frighteningly short and I'm not sure where to go from there to make it actually work:

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Pewpewarrows
The best way I can see to do this straight with the Django ORM is: >> >> prop_dates = >> Target.objects.annotate(latest_property=Max('property__export_date')).values_list('latest_property', >> >> flat=True) >> properties = Property.objects.filter(export_date__in=prop_dates) >> > > Let say I

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Pewpewarrows
I don't understand the 10-15 limit either. I've done giant "in" queries in the past that perform fine with large data sets and proper indexing. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Thorsten Sanders
On 09.09.2011 17:36, Daniel Gagnon wrote: On Fri, Sep 9, 2011 at 9:28 AM, Pewpewarrows > wrote: Tim Shaffer's response would have you doing N+1 queries, and having to loop through all of your Target objects in-memory.

Re: django-registration + csrf token

2011-09-09 Thread Brett Hutley
You need to add it to the registration_form.html as well. Make sure you have 'django.middleware.csrf.CsrfViewMiddleware', in the MIDDLEWARE_CLASSES tuple in the settings.py file. Cheers, Brett On 9 Sep 2011, at 16:47, nicolas HERSOG wrote: > Hi All ! > > Do any of you use this app >

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
Thanks for both responses; I have what I need now. On Fri, Sep 9, 2011 at 9:09 AM, Leonardo Giordani < giordani.leona...@gmail.com> wrote: > Hi Christos, > > if you put > > {% extends "somefile.html" %} > > in your template, Django expects to find it in one of the directories > specified in your

django-registration + csrf token

2011-09-09 Thread nicolas HERSOG
Hi All ! Do any of you use this app https://bitbucket.org/ubernostrum/django-registration/overview with the csrf middleware ? Instead of re-write myself the registar, check via email, lost password, login and co i tried to use this app, but it don't work and i have this message : Forbidden (403)

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Simon Riggs
On Fri, Sep 9, 2011 at 4:33 PM, Christophe Pettus wrote: > > On Sep 9, 2011, at 6:28 AM, Pewpewarrows wrote: > >> prop_dates = >> Target.objects.annotate(latest_property=Max('property__export_date')).values_list('latest_property', >> flat=True) >> properties =

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Daniel Gagnon
On Fri, Sep 9, 2011 at 9:28 AM, Pewpewarrows wrote: > Tim Shaffer's response would have you doing N+1 queries, and having to loop > through all of your Target objects in-memory. Technically it would work, but > as soon as you have a decently sized amount of data in there

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
On Sep 9, 2011, at 6:28 AM, Pewpewarrows wrote: > prop_dates = > Target.objects.annotate(latest_property=Max('property__export_date')).values_list('latest_property', > flat=True) > properties = Property.objects.filter(export_date__in=prop_dates) Note that if prop_dates has more than 10-15

Re: How to use ManyToMany model relations to track user membership?

2011-09-09 Thread Darren
It sounds like you want to specify a custom many-to-many relationship table using the manytomany.through option. Check out https://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany for an example. On Sep 9, 12:10 am, jollyroger wrote: > Hi. > >

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Leonardo Giordani
Hi Christos, if you put {% extends "somefile.html" %} in your template, Django expects to find it in one of the directories specified in your TEMPLATE_DIRS variable in settings.py. They are considered in the order they are written, so the base.html you are extending is the first you find in

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Pewpewarrows
Tim Shaffer's response would have you doing N+1 queries, and having to loop through all of your Target objects in-memory. Technically it would work, but as soon as you have a decently sized amount of data in there it'd slow to a crawl. The best way I can see to do this straight with the Django

Multitenant in Django

2011-09-09 Thread sjtirtha
Hi, I'm looking for the best solution to have a multitenant in django. Site Framework is often mentioned support multitenant. But site framework is developed for websites which have several static sites. What I' looking for now is multitenant and not multi site. So I want to have the

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Eric Hutchinson
Django itself doesn't ship any templates. In order to understand where all your templates are, and how the {% extends 'template.html' %} functionality works, it's best to read the docs. https://docs.djangoproject.com/en/1.3/topics/templates/#id1 is a good starting point in this case. On Sep 9,

Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
"site_base.html", directly under the templates folder, extends a "base.html". Where is the base.html? I see several under the project heirarchy somewhere, and I'd like to know which one of them site_base.html extends (if it does so), or else where I can go to edit site_base.html. -- [image:

Re: How do I render a template variable inside a for loop, when the var is a dict and the key is forloop.counter

2011-09-09 Thread Andre Terra
I get it now.. Then go with the hackier solution I proposed! On Thu, Sep 8, 2011 at 6:18 PM, Rami wrote: > Thanks. > But note that I'm not looking for the dict value in MyList, rather: I > loop on MyList and (trying to) retrieve the dict value from (another > var) BOOK_PHONE

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Tim Shaffer
Maybe something like this... for target in Target.objects.all(): property = target.property_set.latest("export_date") print target.name, target.t1, target.t2, property.export_date, property.p1, property.p2 -- You received this message because you are subscribed to the Google Groups