Mod_wsgi from source + centos 4.8 compile issue

2009-11-05 Thread Sam Walters
Hi I am trying to get mod_wsgi installed on a production server. Apache: 1.3.37 Kernel: 2.6.17.13-vs2.0.2.1vs-1.00 Os: CentOS 4.8 Following instructions from: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide at the point with: ./configure --with-apxs=/usr/local/apache/bin/apxs

Display a view of a single record?

2009-11-05 Thread derek
One of the needs I have (and, I imagine, others too) is to be able to display a view of a single record in a table. This is the case when the record has many fields, not all of which are appropriate for (or need to be) display in the normal list view. What I need to know is: is this a

Re: Definitive solution for foreignkey filtering in Admin

2009-11-05 Thread Tim Valenta
After considering the severe disadvantage imposed by lacking a handling case for the 'add' view, I figured it out and wrote it up here, for the sake of more verbose documentation: http://mangos.dontexist.net/blog/?p=345 Primarily, the idea is that for inlines, I can grab the hidden field

Re: Original path associated with an InMemoryUploadedFile

2009-11-05 Thread Margie Roginski
Yeah, that makes sense. Thanks! Margie On Nov 5, 5:21 pm, Karen Tracey wrote: > On Thu, Nov 5, 2009 at 6:53 PM, Margie Roginski > wrote: > > > > > > > In my app, my user inputs one more more attachments and on the server > > side I am

Sessions for Anonymous Users

2009-11-05 Thread Sean Brant
So I have a invite system for one of my projects and right now when a user clicks the link /invitations// I get the invitation object and store it in request.session['invitation']. Then I redirect to / accounts/new/ if request.session['invitation'] is None then I produce and error if not I

Re: queryset with extra and aggregate fails

2009-11-05 Thread davisd
Okdoke, well here's an inventive workaround for now, hope this helps someone else. calculated_items = Item.objects.filter(cart=self).extra(select= {'calculated_price': 'SUM(unit_price * quantity)'})[:1] return calculated_items[0].calculated_price if calculated_items.count () > 0 else 0 I should

Re: Problem on deploying multi-projects on multi-ports with Apache/mod_python

2009-11-05 Thread Graham Dumpleton
On Nov 5, 8:42 pm, Graham Dumpleton wrote: > On Nov 5, 5:49 pm, Jason wrote: > > > I have 2 projects, and I want to visit project1 at:http://localhost:8080/, > > and visit project2 athttp://localhost:8088/. > > I am not sure if there is a way to

Re: GenericForeignKey with content_type in a related model ???

2009-11-05 Thread Jesse Legg
You won't be able to use a GenericForeignKey in this situation, but you could write a helper method and define a property to affect something similar. For example: class ModelTwo(models): model_one = models.ForeignKey(ModelOne) object_id = models.PositiveIntegerField() def

Re: Problem on deploying multi-projects on multi-ports with Apache/mod_python

2009-11-05 Thread Jason
Dear Graham, Thank you for your time! The problem is solved after I add a ServerName directive to each VirtualHost section. Thanks, Jason On Nov 5, 5:42 pm, Graham Dumpleton wrote: > On Nov 5, 5:49 pm, Jason wrote: > > > I have 2 projects, and I

Problem with combined Authentication/Login view.

2009-11-05 Thread eelinow
I have been using Django for several years now and up until this point have always redirected users to a login page after registering their account, and therefore have never had a problem of this sort. I am currently running Django v1.01 and on a new yet-to-be-released site have a combined

Re: Original path associated with an InMemoryUploadedFile

2009-11-05 Thread Karen Tracey
On Thu, Nov 5, 2009 at 6:53 PM, Margie Roginski wrote: > > In my app, my user inputs one more more attachments and on the server > side I am successfully getting them via code like this: > >for file in request.FILES.getlist('attachment'): >

Re: Customizing error message for unique ModelForm field

2009-11-05 Thread Karen Tracey
On Thu, Nov 5, 2009 at 5:46 PM, aa56280 wrote: > > Also, I'd like to customize the error returned when someone tries to > save the slug with invalid characters, such as spaces. That one > currently says "Enter a valid 'slug' consisting of letters, numbers, > underscores or

Re: Customizing error message for unique ModelForm field

2009-11-05 Thread Karen Tracey
On Thu, Nov 5, 2009 at 5:38 PM, aa56280 wrote: > > I have a ModelForm with a slug field with unique=True. I need to make > the error message a bit more "friendly." Is there a way to override > the default error message? The default is: "[model_name] with this > [field_label]

Re: queryset with extra and aggregate fails

2009-11-05 Thread Karen Tracey
On Thu, Nov 5, 2009 at 4:10 PM, davisd wrote: > > Adding an extra field (calculated_price): > > calculated_items = Item.objects.filter(cart=self).extra(select= > {'calculated_price': 'unit_price * quantity'}) > > works great and the queryset items have the new

Strange, random errors using autocommit: True

2009-11-05 Thread Christophe Pettus
Greetings, I've been wrestling with a very strange set of errors in Django 1.1.1 using psycopg2 as the back end, and DATABASE_OPTIONS "autocommit": True feature. I was looking for the right combination of options and decorators such that Django would not automatically wrap view functions

Original path associated with an InMemoryUploadedFile

2009-11-05 Thread Margie Roginski
In my app, my user inputs one more more attachments and on the server side I am successfully getting them via code like this: for file in request.FILES.getlist('attachment'): a = Attachment( filename = filename,

Re: Problems width add_to_class

2009-11-05 Thread Matt Schinckel
On Nov 6, 7:34 am, Sandra Django wrote: > Hi friends, I have a problem. I'm trying to add to User class of Django an > attribute. For that I'm using add_to_class method. I did the following: > >    1. Delete from Data Base the tables: «auth_user», «auth_user_groups» y >  

Re: Definitive solution for foreignkey filtering in Admin

2009-11-05 Thread Tim Valenta
I don't know what changed, but updating my SVN in the last week sometime has fixed the problem that I was having. The dev trunk and I have a love-hate relationship :) I would make a note to anybody reading this that if the 'add' view is being used, you should kick off the code block with a "if

Re: Django-Registration and Email Permission

2009-11-05 Thread JohnL
Some on Linode IRC suggests that I install ssmtp package...I followed the instruction found here http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/ and reboot the servers...everything works great now. On Nov 5, 12:19 pm, mm wrote: >

Re: Password encryption

2009-11-05 Thread Vany
You can use the same method that django uses I've tried it and it works in your model inside the class for example users and after the definitions of the fields write def save(self): raw_password = self.password import random algo = 'sha1' salt =

Re: Customizing error message for unique ModelForm field

2009-11-05 Thread aa56280
Also, I'd like to customize the error returned when someone tries to save the slug with invalid characters, such as spaces. That one currently says "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens." The terms slug doesn't make sense to some of my users. On Nov 5, 4:38 

Re: GenericForeignKey with content_type in a related model ???

2009-11-05 Thread Brian McKeever
Why do you want to split it across two models? On Nov 5, 9:25 am, bruno desthuilliers wrote: > Hi all > > I have this pattern: > > class ModelOne(models): >     content_type = models.ForeignKey(ContentType) > > class ModelTwo(models): >     model_one =

Customizing error message for unique ModelForm field

2009-11-05 Thread aa56280
I have a ModelForm with a slug field with unique=True. I need to make the error message a bit more "friendly." Is there a way to override the default error message? The default is: "[model_name] with this [field_label] already exists." --~--~-~--~~~---~--~~ You

Problems width add_to_class

2009-11-05 Thread Sandra Django
Hi friends, I have a problem. I'm trying to add to User class of Django an attribute. For that I'm using add_to_class method. I did the following: 1. Delete from Data Base the tables: «auth_user», «auth_user_groups» y «auth_user_user_permissions». 2. In models.py of «main» aplication I

Re: tag counts

2009-11-05 Thread Max Battcher
dk wrote: > I am making a site to contain "examples" that may be tagged with > "tags". I am wondering how to count the uses of the tags (for making > a tag cloud, for example). Your best bet for tags is to use django-tagging: http://django-tagging.googlecode.com/ That app provides just about

Problem with distinct and count

2009-11-05 Thread diegueus9
Hi Guys, I have two models, with a foreign key from the first two the second, and I need make a kind of group py and count, I try this but don't works: a = Congresista.objects.filter(profesion=3).annotate(Count('partido_politico')).distinct('partido_politico') 'partido_politico' is the

queryset with extra and aggregate fails

2009-11-05 Thread davisd
Adding an extra field (calculated_price): calculated_items = Item.objects.filter(cart=self).extra(select= {'calculated_price': 'unit_price * quantity'}) works great and the queryset items have the new calculated_price field. calculated_items.aggregate(Sum('calculated_price')) raises an

Re: Comments & redirection

2009-11-05 Thread f4nt
I used a cheap hack. The comment object has an ID of the item that the comment was attached to. You can then give users a link to that to click, or auto-redirect them to that. If you use slugs, you can create a view that catches that ID, grabs the slug, and thus redirects them again to the

Re: Comments & redirection

2009-11-05 Thread Ethan Jucovy
On Thu, Nov 5, 2009 at 2:30 PM, David wrote: > Is it possible to redirect upon successful comment submission to the > previous page when using Djangos built in render_comment_form ? > I'm not sure if there's a more direct way, but you can override the "comment_done"

Comments & redirection

2009-11-05 Thread David
Hello Is it possible to redirect upon successful comment submission to the previous page when using Djangos built in render_comment_form ? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Where to put utility functions...

2009-11-05 Thread apramanik
Thanks for the replies! I ended up creating a python package in the site's directory. Abhik On Nov 5, 8:35 am, bruno desthuilliers wrote: > On 5 nov, 16:52, apramanik wrote: > > > Hey all, > > > If I have some utility functions I want to share