Re: ImageFile bug? (Re: ImageField questions)

2009-07-27 Thread Rusty Greer
On Sun, Jul 26, 2009 at 10:28 PM, Jacob Kaplan-Moss wrote: > > 2009/7/24 Rusty Greer : >> that bug actually doesn't fix my case.  if i alter the patch to just >> do a file.close() in all cases, it works.  is there another patch to >> close the file opened

Re: problem: TemplateDoesNotExist at /admin/ (linux)

2009-07-27 Thread Alexandru Nedelcu
On Sun, 2009-07-26 at 15:15 -0700, LuXo Jarufe wrote: > Hi, I want to use the admin but I have this problem, I was following > the tutorial in djangoproject but when I execute the admin this > appears: > > TemplateDoesNotExist at /admin/ Hi, In settings.py you have a setting named ...

Re: how to use form_class with generic views?

2009-07-27 Thread djangonoob
hi thanks for your reply. may i know if the code you wrote exists in urls.py? or can i seperate them as per normal? For example: # models.py class MyFormClass(ModelForm): class Meta: model = MyModelClass #urls.py urlpatterns = = patterns('',

Re: how to use form_class with generic views?

2009-07-27 Thread djangonoob
oh by the way, i've tried your method and i received the error: 'NoneType' object is not callable May i know how do i solve this issue? Best Regards, Eugene On Jul 27, 12:15 pm, Vasil Vangelovski wrote: > First you create a ModelForm: > > from django.forms import

Re: Chained Views - as in Catalyst (perl)

2009-07-27 Thread Alexandru Nedelcu
On Mon, Jul 27, 2009 at 2:55 AM, Alexandru Nedelcu wrote: > I do miss a feature from Catalyst ... chained actions. > I added this functionality to Django by myself (just a few hours > hack), see here (example + code): >    http://code.google.com/p/django-catalyst/ I updated the

Re: Chained Views - as in Catalyst (perl)

2009-07-27 Thread Joshua Partogi
This looks cool Alexandru. What I can see it really leverage the capability of generic views. I hate repeating too. And your solution seems to be very elegant. Going to test it out. On Mon, Jul 27, 2009 at 4:51 PM, Alexandru Nedelcu wrote: > > On Mon, Jul 27, 2009 at 2:55 AM,

Problems with mod_wsgi and django

2009-07-27 Thread Parag Shah
Hello, I am trying to configure Apache2 server with mod_wsgi for my Django application. However when I try to access the website I get the following msg on the browser: Forbidden You don't have permission to access / on this server. Here are the contents of my httpd.conf which has been setup

Re: Problems with mod_wsgi and django

2009-07-27 Thread Graham Dumpleton
On Jul 27, 5:02 pm, Parag Shah wrote: > Hello, > > I am trying to configure Apache2 server with mod_wsgi for my Django > application. However when I try to access the website I get the following > msg on the browser: > > Forbidden > > You don't have permission to access /

Re: Problems with mod_wsgi and django

2009-07-27 Thread Boštjan Jerko
On 27.7.2009, at 9:02, Parag Shah wrote: > > When I look into my Apache error.log file I see the following line: > > (13)Permission denied: /root/.htaccess pcfg_openfile: unable to > check htaccess file, ensure it is readable > > I do not have a .htaccess file in /root, but I do not

Re: Non ASCII URL characters in Django

2009-07-27 Thread Shivaraj
Let me repeat the original question. If I put a nonASCII character to urlopen / urlencode and try to open an url in python prompt it works fine. So it's not issue with python(2.6+) as of now. Now I call the same functions from Django and it reports error. I will give you a simple scenario. Try

User-expandable models and admin stuff?

2009-07-27 Thread Christopher Hart
I'm interested in writing a personal database Django app that allows users to create additional models through the admin site, running automatic syncdb and then having a layer which allows them to create admin forms for those models. Either that or the app would just automatically generate really

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
Matthias Kestenholz wrote: > Is this your complete Membership model? Or do you have additional > fields there? If you've only got these two foreign keys, it might be > better to use a many to many field that references the same model ( > ManyToManyField('self') ) Thanks Matthias - exactly

Re: Session problem

2009-07-27 Thread Subramanyam Vemu
Hi Boris Can you update the code/snippet that you are using coz I faced a similar issue while I was working on a project On Sun, Jul 26, 2009 at 4:06 AM, Boris Ozegovic wrote: > > At the moment I am experiencing difficulties with Django session > middleware. For some

Re: Foreign key triggered some redundant SQL queries

2009-07-27 Thread Tom
Found the answer to my question just after posting... for item in FOO.objects.select_related('bar'): print item.bar.id On Jul 19, 11:33 pm, Alex Gaynor wrote: > On Sun, Jul 19, 2009 at 10:48 AM, aXqd wrote: > > > Hi, all: > > > Recently, I linked two

Generate to PDF file with Reportlab

2009-07-27 Thread veasna bunhor
Dear all, I am working on generating file to PDF. The problem is that it does not support the Khmer Unicode font. Does any one know why ? and how can i solve with this? Here is my code: from ahrm.main.models import Employee,Experience,Education,Skill, Company from django.contrib.auth.decorators

Re: Foreign key triggered some redundant SQL queries

2009-07-27 Thread Tom
Hi, Thanks for the tip... But I've got a similar problem that needs the data from the linked model: (simple example) for school in SCHOOL.objects.all(): print school.student.name When I run this in Django it makes a separate SQL call every time it tries to get school.student.name. It

Re: Problems with mod_wsgi and django

2009-07-27 Thread Parag Shah
Thanks to everyone for your help. The problem was with permissions. Once I gave o+rx to www-data, it started working. -- Thanks & Regards Parag Shah http://blog.adaptivesoftware.biz On Mon, Jul 27, 2009 at 12:40 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > > On Jul 27, 5:02

Re: Editing model based forms.

2009-07-27 Thread AKK
Is there a way to do this or should i create my own form manually? Andrew On Jul 27, 12:15 am, AKK wrote: > Hi, I have a form based on a model which allows users to add comment. > A comment is made up of the comment is about, the body, the date and > time and also

how to use the url tag with optional arguments?

2009-07-27 Thread Kenneth Gonsalves
hi latest trunk. in my urls.py I have a url: url(r'^addlandmark/((?P\d+)/)?$', 'addlandmark', name='add_landmark'), as can be seen, the id part is optional. In my template I have: Edit this entry this does not work as it says Reverse not found. How does one use this tag when the argument is

Re: how to use form_class with generic views?

2009-07-27 Thread Vasil Vangelovski
First, of course you should separate that code, and form classes usually go in forms.py, models in models.py. Second, you are getting a 'NoneType object is not callable' beacause of what you have in urls.py. Look at that carefully and you'll figure it out. djangonoob wrote: > oh by the way, >

Re: how to use the url tag with optional arguments?

2009-07-27 Thread Malcolm Tredinnick
On Mon, 2009-07-27 at 16:30 +0530, Kenneth Gonsalves wrote: > hi > latest trunk. > in my urls.py I have a url: > > url(r'^addlandmark/((?P\d+)/)?$', 'addlandmark', name='add_landmark'), You have nested capturing groups here, which is almost always an error. You have also mixed positional and

Re: Non ASCII URL characters in Django

2009-07-27 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 3:26 PM, Shivaraj wrote: > > Let me repeat the original question. > If I put a nonASCII character to urlopen / urlencode and try to open > an url in python prompt it works fine. > So it's not issue with python(2.6+) as of now. > > Now I call the same

Re: Editing model based forms.

2009-07-27 Thread Daniel Roseman
On Jul 27, 12:15 am, AKK wrote: > Hi, I have a form based on a model which allows users to add comment. > A comment is made up of the comment is about, the body, the date and > time and also who made the comment. > > I am mainly interested in the datetime and user

Re: how to use the url tag with optional arguments?

2009-07-27 Thread Kenneth Gonsalves
On Monday 27 Jul 2009 4:55:42 pm Malcolm Tredinnick wrote: > > url(r'^addlandmark/((?P\d+)/)?$', 'addlandmark', > > name='add_landmark'), > > You have nested capturing groups here, which is almost always an error. > You have also mixed positional and named arguments, for bonus confusion > (if

Re: how to use the url tag with optional arguments?

2009-07-27 Thread Kenneth Gonsalves
On Monday 27 Jul 2009 5:21:46 pm Kenneth Gonsalves wrote: > > can't handle anything except the outermost capturing groups in a > > reg-exp. > > > > I suspect you intend your pattern to be > > > > r'^addlandmark/(?:(?P\d+)/)?$' > > > > changing the optional portion to be a

form and hidden input with user id

2009-07-27 Thread Salvatore Leone
Hello, I'm building an application with a simple form for asking questions to the site's administrators. I created the form using the ModelForm object. Every Question object has a text and an author_id, which is the id of the user currently logged in. Automagically generating the form is

Re: Foreign key triggered some redundant SQL queries

2009-07-27 Thread Karen Tracey
On Mon, Jul 27, 2009 at 4:04 AM, Tom wrote: > > Hi, > > Thanks for the tip... > > But I've got a similar problem that needs the data from the linked > model: > > (simple example) > > for school in SCHOOL.objects.all(): > print school.student.name > > When I run this in Django

Re: Generate to PDF file with Reportlab

2009-07-27 Thread Karen Tracey
On Mon, Jul 27, 2009 at 4:52 AM, veasna bunhor wrote: > Dear all, > > I am working on generating file to PDF. The problem is that it does not > support the Khmer Unicode font. Does any one know why ? and how can i solve > with this? > What is the "it" that "does not

best way to format serialized data?

2009-07-27 Thread DaleB
hi all, i am just experimenting with ajax following the liveblog-example from 'python web development with django' (http://withdjango.com/). everything works really good apart from the fact the i don't manage to format the serialized data, that is returned by the ajax call: jQuery.each(data,

Re: Auth test with custom auth backend

2009-07-27 Thread Vitaly Babiy
Yeah, I have thought about removing auth from my installed app but the problem is I am going to be using the permissions part of the app. Have the auth app support a custom model would be cool. Also it might not be to bad to write a custom test runner that will ignore test from apps listed in a

Re: Url Namespaces

2009-07-27 Thread Vitaly Babiy
Thanks, I knew it had to be somewhere in the docs. Vitaly Babiy On Sun, Jul 26, 2009 at 7:16 PM, Vasil Vangelovski wrote: > > See this: > > > http://docs.djangoproject.com/en/dev/topics/http/urls/#defining-url-namespaces > > On Mon, Jul 27, 2009 at 12:13 AM, Vitaly

Re: Non ASCII URL characters in Django

2009-07-27 Thread Shivaraj
Sorry ,a little bit of complication which I overlooked was the issue. I escaped a URL parameter to urls.py which took some form like http://mysite?param=%u0410%u0433%u0430 and then I unquoted it and converted to unicode by param = unquote(param) result =

Re: how to use the url tag with optional arguments?

2009-07-27 Thread Michael
On Mon, Jul 27, 2009 at 7:58 AM, Kenneth Gonsalves wrote: > > On Monday 27 Jul 2009 5:21:46 pm Kenneth Gonsalves wrote: > > > can't handle anything except the outermost capturing groups in a > > > reg-exp. > > > > > > I suspect you intend your pattern to be > > > > > >

Cross Table Query. List Books based on Author.

2009-07-27 Thread The Danny Bos
Heya, I'm currently displaying an 'Article' on a page, using the below. My tables are Article, People, Book. I'm in the 'Article' table, trying to get a list of 'Books' based on the person "selected" in Articles, that person needs to be the Author of the 'Books'. Dig? # views.py def

Full-text search: what to use

2009-07-27 Thread alex finn
Hello, I'm working on a huge django-based application that heavily utilizes full-text search. Up until now I've been using external search service built using SOLR that is deployed separately. The problem is with such an approach I need to maintain 2 different environments - one for

Question on the ticket #11563

2009-07-27 Thread Daybreaker
See http://code.djangoproject.com/ticket/11563 :) Yes, I had to ask it here first, but I didn't think autodiscover() is the only(?) way to be recommended, so I thought that was a bug. So my question is the last comment there -- Is autodiscover() the only way that is recommended as the official

Re: Question on the ticket #11563

2009-07-27 Thread Ramiro Morales
On Mon, Jul 27, 2009 at 12:20 PM, Daybreaker wrote: > > See http://code.djangoproject.com/ticket/11563 :) > > Yes, I had to ask it here first, but I didn't think autodiscover() is > the only(?) way to be recommended, so I thought that was a bug. > > So my question is the

Re: Question on the ticket #11563

2009-07-27 Thread Daybreaker
I've read that part many times again and again... I've just found that even admin.autodiscover() does not work for my models. The Django default contrib apps' models showed up in the admin interface, but not my models. Of course, I removed all manually- inserted 'admin.site.register(...)'

iterating through user.groups

2009-07-27 Thread Salvatore Leone
Hi, anyone knows why this code: {% for group in user.groups%} {{group.name}} {%endfor%} raise this exception: "Caught an exception while rendering: 'ManyRelatedManager' object is not iterable" The same if I put the code inside my view (for group in user.groups:) any idea?

Re: iterating through user.groups

2009-07-27 Thread Alex Gaynor
On Mon, Jul 27, 2009 at 10:54 AM, Salvatore Leone wrote: > > Hi, > > anyone knows why this code: > > {% for group in user.groups%} >      {{group.name}} > {%endfor%} > > raise this exception: > > >      "Caught an exception while rendering: 'ManyRelatedManager' object

Re: Cross Table Query. List Books based on Author.

2009-07-27 Thread Daniel Roseman
On Jul 27, 4:13 pm, The Danny Bos wrote: > Heya, > > I'm currently displaying an 'Article' on a page, using the below. My > tables are Article, People, Book. I'm in the 'Article' table, trying > to get a list of 'Books' based on the person "selected" in Articles, > that

Re: Permissions independent of models

2009-07-27 Thread Peter Sagerson
The way I solved this was to write a custom auth backend that could evaluate a collection of non-model permissions. By convention, I had one permission per view. Some of these permissions were aliased to corresponding model permissions and some of them were based on other criteria.

Application level data

2009-07-27 Thread vishy
Hi, I have some data which I don't want to get from database for every user request.How should I make such data available to all users(like caching?)? What options are available in Django? thanks --~--~-~--~~~---~--~~ You received this message because you are

Re: Application level data

2009-07-27 Thread Luke Seelenbinder
Look at the official caching documentation: Low-level API (for individual data pieces) http://docs.djangoproject.com/en/dev/topics/cache/#the-low-level-cache-api That should work for you Luke S. On 07/27/2009 12:21 PM, vishy wrote: > Hi, > > I have some data which I don't want to get from

Re: Where are the admin app icons from?

2009-07-27 Thread Margie
Yeah ... I know where the icons used in the admin app are. And I'm using them in my own app (which is derived from the admin app). So I was just trying to figure out if they came from some general package of icons where there were more with the same look and feel. Based on Daniel's reply, it

Re: Where are the admin app icons from?

2009-07-27 Thread Luke Seelenbinder
I think they are the FamFamFam Icon pack. http://www.famfamfam.com/ Luke S. On 07/27/2009 02:10 PM, Margie wrote: Yeah ... I know where the icons used in the admin app are. And I'm using them in my own app (which is derived from the admin app). So I was just trying to figure out if they

Re: Where are the admin app icons from?

2009-07-27 Thread Margie
Yeah, I looked at those and they are very nice, but not quite the same, and the size differences seem to be a problem. My graphic design skills are pretty minimal. I tried scaling them down to the size I need in gimp, but they didn't look very good after that. Tried the "minis" in that set as

Re: Where are the admin app icons from?

2009-07-27 Thread Luke Seelenbinder
Could you resize them simply with CSS? CSS handles resizing quite well. I did find one set of icons sized at 10x10 here: http://www.brandspankingnew.net/archive/2006/12/hohoho.html But they are greyscale. Luke S. On Mon, Jul 27, 2009 at 3:07 PM, Margie wrote: > >

Re: Editing model based forms.

2009-07-27 Thread AKK
Thanks, that will work for time. I want the username value to be added without the user typing it in because they can type anything and its a bit silly to get them to type in there username everytime they want to comment. So i want the {{ user.username }} value to be automatically detected and

Re: Database connection closed after each request?

2009-07-27 Thread Glenn Maynard
On Sun, Jul 26, 2009 at 10:17 PM, Amitay Dobo wrote: > So to sum up: I vote up connection pooling. Where do I sign up? Thread hijacking. Thanks, always appreciated. -- Glenn Maynard --~--~-~--~~~---~--~~ You received this message because you

Admin interface : 'HttpResponseRedirect' object has no attribute 'rindex'

2009-07-27 Thread swan...@gmail.com
Hy, i met a recursive error in admin feature. - I noticed that somes models admin's views are not affected by the error. - produce only in add/ and per-entry view (update page of entry) - list views shows me all my entry with no problem for all models declared I reproduce this error with multi

Fatal Python error: Inconsistent interned string state.

2009-07-27 Thread Ken Schwencke
I'm working with GeoDjango and PostGIS, and I'm getting "Fatal Python error: Inconsistent interned string state." errors randomly while using the development server. It doesn't happen on any specific view (it's happened on the two main views), it doesn't happen while doing any specific query, it

Re: Editing model based forms.

2009-07-27 Thread Ramiro Morales
On Mon, Jul 27, 2009 at 7:52 AM, AKK wrote: > > Is there a way to do this or should i create my own form manually? > > Andrew > > On Jul 27, 12:15 am, AKK wrote: >> Hi, I have a form based on a model which allows users to add comment. >> A

Re: Cross Table Query. List Books based on Author.

2009-07-27 Thread The Danny Bos
Good point, here are the models for all three tables. I would have thought the above would work too, but it errors: Error: Caught an exception while rendering: Error binding parameter 0 - probably unsupported type. Here's my Table definitions. #models.py class Book(models.Model):

Re: Chained Views - as in Catalyst (perl)

2009-07-27 Thread Alexandru Nedelcu
On 27 iul., 10:01, Joshua Partogi wrote: > This looks cool Alexandru. What I can see it really leverage the capability > of generic views. I hate repeating too. And your solution seems to be very > elegant. Going to test it out. I also added automatic generation of

Re: Caught an exception while rendering: Error binding parameter 0 - probably unsupported type.

2009-07-27 Thread The Danny Bos
How did you solve it? I'm having the same issue. d On Jul 27, 12:09 pm, nixon66 wrote: > problem solved. Type > > On Jul 26, 10:05 pm, nixon66 wrote: > > > > > ran into this error. Anyone familiar with it. > > > TemplateSyntaxError at

Trying to reference a foreignKey in a modelAdmin class

2009-07-27 Thread irishsteve
Hi I'm new to Django, so thanks in advance for taking the time to help me! I can't work out how to reference a foreignKey in the list_filter method. Here are the two relevant objects from my model: class Competition(models.Model): name = models.CharField("Event title", max_length=200)

I just need some feedback and advice about my project layout and design.

2009-07-27 Thread chyea
Hi all, I'm writing a very small, simple video game news media site. I'm starting off small, with just Blurbs and Reviews. The Blurbs are basically quick news articles. The Reviews are extensive articles about a video game, ofcourse. So, since both Blurbs and Reviews are both types of articles,

Re: Trying to reference a foreignKey in a modelAdmin class

2009-07-27 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What error exactly is it throwing? I noticed this: is it supposed to be: list_filter('Competition.startDate', 'Division')? Hope that helps. We really need the error it is throwing to more accurately diagnose and repair. Luke S. irishsteve wrote:

Re: Where are the admin app icons from?

2009-07-27 Thread Margie
I'll try the css idea, but I suspect that things this small just can't be resized well. I actually contacted Wilson Miner, and he said that he did create those especially for the admin site. When I asked him about scaling other images (like the famfam ones, which he also pointed me to), he

Re: Where are the admin app icons from?

2009-07-27 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 No problem, glad to help. At that size things really are hard to deal with, hope you find the solution. Luke S. Margie wrote: > > I'll try the css idea, but I suspect that things this small just can't > be resized well. I actually contacted

Re: Trying to reference a foreignKey in a modelAdmin class

2009-07-27 Thread Karen Tracey
On Mon, Jul 27, 2009 at 6:01 PM, irishsteve wrote: > > Hi > > I'm new to Django, so thanks in advance for taking the time to help > me! I can't work out how to reference a foreignKey in the list_filter > method. > > Here are the two relevant objects from my model: > > [snip]

Re: Full-text search: what to use

2009-07-27 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 11:14 PM, alex finn wrote: > > Hello, > > I'm working on a huge django-based application that heavily utilizes > full-text search. Up until now I've been using external search service > built using SOLR that is deployed separately. > The problem is with

Re: Chained Views - as in Catalyst (perl)

2009-07-27 Thread Joshua Partogi
Nice! This is really RESTful. Great job man. On Tue, Jul 28, 2009 at 7:54 AM, Alexandru Nedelcu wrote: > > On 27 iul., 10:01, Joshua Partogi wrote: > > This looks cool Alexandru. What I can see it really leverage the > capability > > of generic views.

python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
ImageFields worked just fine until I moved to a new server. Now I get error messages "Upload a valid image". I know the images are fine, the media root and www_url are correct, so what else could this be? Ideas are greatly appreciated! Cody

python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
All imagefields give this error: Upload a valid image. The file you uploaded was either not an image or a corrupted image. I suspect that imagefield itself is compatible with python 2.3, so where else could the problem be? It's not with the image. Ideas are greatly appreciated... Thanks.

Re: Beginner

2009-07-27 Thread Lee Connell
windows vista and windows 7 support symlink, use the mklink command On Mar 15, 2009, at 10:59 AM, Alex Gaynor wrote: > > > On Sun, Mar 15, 2009 at 9:57 AM, TP wrote: > > Thanks for you help. > > I have tried this but im not sure I am doing it correctly... > > What is

Re: how to use form_class with generic views?

2009-07-27 Thread djangonoob
hi, in my urls.py i have imported the MyFormClass from models.py However i am still receiving the error 'NoneType object is not callable' What else do i need to import? Here is the things i have imported in urls.py #urls.py from django.conf.urls.defaults import * from django.conf import

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
Please disregard my previous - I've got something happening/hatching Thanks Matthias and Daniel Mike Mike Dewhirst wrote: > Matthias Kestenholz wrote: > > > >> Is this your complete Membership model? Or do you have additional >> fields there? If you've only got these two foreign keys, it

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Darryl Ross
Cody Django wrote: > ImageFields worked just fine until I moved to a new server. Now I get > error messages "Upload a valid image". I know the images are fine, > the media root and www_url are correct, so what else could this be? > Ideas are greatly appreciated! Do you have PIL installed on the

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
checked: - pil supports jpgs - permissions set to 775 on upload folders On Jul 27, 7:44 pm, Cody Django wrote: > All imagefields give this error: Upload a valid image. The file you > uploaded was either not an image or a corrupted image. > > I suspect that imagefield

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
Daniel and Matthias Thanks for your help. I finally figured out I don't need any automatic Django n:m at all! I just made my own n:m table and everything works the way I expect. I'll really try to keep things simple from now on ... Cheers Mike Mike Dewhirst wrote: > Matthias Kestenholz

easy way of display an user bar?

2009-07-27 Thread Jason Wang
Hi all, I have a base.html from which almost all of my templates are derived, and i would like to place a "user bar" on top of every page, so that the user have easy access to their profiles and such. Would i need to pass request.user along to every view in context to be able to include say

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
yes, and it contains the jpg and gif plugins, which I assume means that it does support jpgs. On Jul 27, 9:15 pm, Darryl Ross wrote: > Cody Django wrote: > > ImageFields worked just fine until I moved to a new server. Now I get > > error messages "Upload a valid image". I

Re: Getting a dynamic model form

2009-07-27 Thread ~Young Devil
Thanks Man!! On Jul 18, 5:24 am, Eugene Mirotin wrote: > So, the value is a string, but the widget you want to display to the > user should be changed according to the key value? > Probably you have to create your custom tag (e.g. render_value_widget) > and then use

Prefetch user profiles

2009-07-27 Thread Andrew Fong
Hi all, I'm using contrib.auth and have set up my own Profile model, linked to the User model with OneToOneField. There are a lot of times when I'd like to prefetch the Profile model when getting the User model -- e.g. User.objects.all().select_related('profile') However, select_related does

Re: Prefetch user profiles

2009-07-27 Thread Alex Gaynor
On Tue, Jul 28, 2009 at 1:19 AM, Andrew Fong wrote: > > Hi all, > > I'm using contrib.auth and have set up my own Profile model, linked to > the User model with OneToOneField. There are a lot of times when I'd > like to prefetch the Profile model when getting the User model