Re: Do you need to include the PK when using unique_together?

2008-04-06 Thread Malcolm Tredinnick
On Sun, 2008-04-06 at 19:54 -0700, meppum wrote: > Is the PK implied when using unique_together or do you need to include > it? No. Since all primary key values are unique, it wouldn't make sense to include them in any unique_together sequence. Regards, Malcolm -- On the other hand, you have

Re: Repeat a string X times, where X is a database value.

2008-04-06 Thread Lee Hinde
Terrific. Thanks. On Apr 6, 7:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I would make a filter there takes a string and repeats it the number > of times in the arg. > > On Apr 6, 9:27 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > Hi; > > > i have a database field "pricing_level".

Making login work with every page.

2008-04-06 Thread shabda
If a user is not logged in, then on each page, I have a login form. This form posts to /accounts/login/ which does calls contrib.auth.views.login. This view only logs in a user if the session.test_cookie_worked(). So this means that from each page I need to call, if not

Re: Repeat a string X times, where X is a database value.

2008-04-06 Thread [EMAIL PROTECTED]
I would make a filter there takes a string and repeats it the number of times in the arg. On Apr 6, 9:27 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > Hi; > > i have a database field "pricing_level". It's an int between 1 and 5. > > In a web page, I'm iterating through a list of products and I want

Repeat a string X times, where X is a database value.

2008-04-06 Thread Lee Hinde
Hi; i have a database field "pricing_level". It's an int between 1 and 5. In a web page, I'm iterating through a list of products and I want to display something like: {% for p in Prod %} {{p.product_level*"$"}} {% endfor %} (along with a bunch of other stuff,

Can POST data be stuck?

2008-04-06 Thread Eric VW
Hey Everyone, I was wondering if someone could click glance over (http://dpaste.com/ 43498/) and let me know if there is any chance that POST data could be stuck on successfull submission or not. I thought I thoroughly tested this with multiple submits, refreshes, and combinations thereof, but

Re: Making user emails unique

2008-04-06 Thread Julien
Thanks for the snippet Michael, it is quite useful. Now hopefully my users won't risk to register with an already-existing email address. However, as you said, I'd like something a bit more consistent so to avoid bad surprises. Forking the contrib.auth is quite tempting, but I've had bad

Re: Calendar app: how to model reccurring events?

2008-04-06 Thread Michael Richardson
> I'm in the process of writing my first Django project, which has a > calendar application. I'm not quite sure how I should model reccurring > events. My first idea was to use a Event table (containing all the > event data), and a RecurringEvent table which has only two rows: > parent

Re: ModelForms check if value has changed.

2008-04-06 Thread Michael
Inside the clean method you have access to self.instance.pk, which returns true if there an instance (with an already established primary key) or false if there isn't already an instance. Hope that helps, Michael On Sun, Apr 6, 2008 at 5:44 PM, Petar <[EMAIL PROTECTED]> wrote: > > Dear

Re: Calendar app: how to model reccurring events?

2008-04-06 Thread Malcolm Tredinnick
On Sun, 2008-04-06 at 11:39 -0700, Benjamin Wohlwend wrote: [...] > That's what I found out pretty soon after trying to implement it. I > 'solved' it by storing the type of the child event in the Event table > and, if necessary, descending to the particular event, depending on > the stored type.

Re: Creating a Random Hash for Invitations

2008-04-06 Thread Alex Ezell
On Sun, Apr 6, 2008 at 1:38 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The way I would handle it is in the save method of the invitation > model I would do: > def save(self, *args, **kwargs): > if not self.pk: > #This is a new invite, we need to generate the code >

Re: Can't post anything to django website, it says i'm spam.

2008-04-06 Thread Karen Tracey
On Sun, Apr 6, 2008 at 5:52 PM, Javier <[EMAIL PROTECTED]> wrote: > > Hi, > > I've been editing the DevelopersForHire page and I get a possible spam > message. > If i go with a proxy it says that too but adds that i've more links > than the allowed max number. > > Also, i wanted to add a ticket

lighttpd & django, fcgi issues

2008-04-06 Thread skunkwerk
I'm having trouble running django with lighttpd (I'm not on a shared host). Here is what I've installed: ubuntu 7.10 lighttpd flup cmemcache python When I go to my web address which maps to the django project directory, all I see is a directory listing, not any django pages. I started fcgi

Can't post anything to django website, it says i'm spam.

2008-04-06 Thread Javier
Hi, I've been editing the DevelopersForHire page and I get a possible spam message. If i go with a proxy it says that too but adds that i've more links than the allowed max number. Also, i wanted to add a ticket about this but i got the same messages. I'm not spamming, look, I'm a human =)

ModelForms check if value has changed.

2008-04-06 Thread Petar
Dear someone, I have a ModelForm for my User (standard django) model. I want to check if the email is unique so I created a clean_email method which works fine. The only problem is that I only want to check the email address when it's changed. Is their a way to get the 'initial' value of the

writing a view similar to generic view

2008-04-06 Thread stranger
Hello all, I am writing a simple blog app. I wrote a post and comment model where I need views to serve them. I could use generic views but I think I cannot due to the fact that comment model needs to link to post model. So i am writing a view which serves url like:

Re: Use django auth db for phpbb?

2008-04-06 Thread Peter Rowell
> - Make PhpBB Use the django auth This is probably the way to go. >I have not the slightest clue on where to start There is no "magic" in the django database. It is just a vanilla MySQL/ PostgreSQL database with vanilla tables. The table you are interested in is auth_users. The only required

Re: Serving binary files "through" django

2008-04-06 Thread Tim Sawyer
On Saturday 05 Apr 2008, Matthias Kestenholz wrote: > On Sat, 2008-04-05 at 20:19 +0100, Tim Sawyer wrote: > > Hi Folks, > > > > I'd like to have a site that gives away and sells PDFs, and tracks > > downloads of those PDFs. For example, I'd like to know the IP > > address/useragent of who

Use django auth db for phpbb?

2008-04-06 Thread truebosko
I am in an odd situation where I need to use a django auth database for a phpbb forum for a friend of mine. He wants the phpbb forums but he is not happy with users having to register for both the phpbb and django side (Which is the main site) My options are: - Whenever a person makes an

Re: Django on a shared host

2008-04-06 Thread Tim Chase
> I just sent a reply, but I guess I don't know how to use Google groups > so well (sorry). I think it went directly to the author instead of > posting here. Yes indeed, it did go directly to me :) > Basically I don't understand Tim's answer and could it > be explained a bit more? I'll see

Re: Django on a shared host

2008-04-06 Thread papertrail
I just sent a reply, but I guess I don't know how to use Google groups so well (sorry). I think it went directly to the author instead of posting here. Basically I don't understand Tim's answer and could it be explained a bit more? Thanks. On Feb 27, 9:15 am, Tim Chase <[EMAIL PROTECTED]>

Re: Calendar app: how to model reccurring events?

2008-04-06 Thread Benjamin Wohlwend
Hi Malcom, thanks for your thorough answer! On Apr 6, 6:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-04-05 at 02:49 -0700, Benjamin Wohlwend wrote: > > > I'm tending to the second design, since I would be able to combine > > both event types in a single queryset. > >

Re: Creating a Random Hash for Invitations

2008-04-06 Thread [EMAIL PROTECTED]
The way I would handle it is in the save method of the invitation model I would do: def save(self, *args, **kwargs): if not self.pk: #This is a new invite, we need to generate the code self.hash = do_something_to_generate_the_hash super(Invite, self).save(*args, **kwargs)

Creating a Random Hash for Invitations

2008-04-06 Thread Alex Ezell
My use case is that I need to send invites via email to people. These are not site users, but are people being invited to join the site (and a particular group on this site) by current users. So, I can't ask them to login, because I have no data about them. They would then click the link in the

Problem with static content + Apache / FastCGI

2008-04-06 Thread Tourneur Henry-Nicolas
Hello, With the development server, I use the following line to manage static content : (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': '/var/www/nicolas/sites/NetPool/web/media/'}), But now, when I run my apps with Apache and FastCGI, it seems that my requests to

Re: ImageField links in admin going no-where

2008-04-06 Thread bergstyle
I got this working. My media url wasn't setup right. If anyone else encounters this issue. I setup my media_url in the settings file and then I point /media to that directory in the web server config. Then for the admin files I created a symlink to them from inside my regular media directory.

Re: Project Topology

2008-04-06 Thread Aaron Blew
I definitely want to be able to have any app easily retrieve data from another. I suppose I'm thinking of each app as a simple web service. Is that a reasonable way to approach it, or should I only separate on significantly different logical functions (ie a couple different models that just have

ImageField links in admin going no-where

2008-04-06 Thread bergstyle
One of my models has an ImageField. The image file uploading and removing works correctly but in the Admin interface it display a link to see the image. Here's what the link looks like: http://admin.domain-dev.com/admin/appname/product/6/product_images/raw/bptestimage.jpg The problem is I just

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread HangingClowns
Alright, what I'm saying is that, it STILL didn't work with the 777 permission, but, my other websites worked with 777. That's what I meant to say, but I'm still getting the "EnvironmentError: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax errors?): No module

Re: EmailMessage and BCC fields

2008-04-06 Thread Tim Sawyer
On Sunday 06 Apr 2008, Karen Tracey wrote: > Update to a revision with the fix for > http://code.djangoproject.com/ticket/6841, that is r7347 or higher. Fixed, thanks! Tim. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread Michael
The fact that it works with 777 permisions means that it was a permissions issue. Be really careful with 777 permissions however on your server that gives full read write execute permissions to everyone. THAT INCLUDES WEB USERS. It won't take much to hack your system if you grant full permissions

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread HangingClowns
Well, after I followed your advice for putting webmastr in the www- data group, I was getting 403 errors and forbidden errors on all of my sites, so I 777 public_html recursively, so now it's all running, I'd suppose that Apache should have access to it. So, from there on, I'm lost at what could

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread Michael
> I've worked on putting Django on a Red Hat machine, and I've noticed > that the Ubuntu version of Apache is a bit different. But, in any > case, In my /etc/apache2 httpd.conf I have: Debian packages are always different in how they are initially set up, but Apache works the same in most

Re: Making user emails unique

2008-04-06 Thread Michael
I have this style of e-mail usernames for my sites and where it might be not as tight as possible, I have an implementation that works. > 1) Make sure that emails are unique. According to the thread [1] > there's no straight forward solution other than patching Django, and I > hate patching

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread HangingClowns
I've worked on putting Django on a Red Hat machine, and I've noticed that the Ubuntu version of Apache is a bit different. But, in any case, In my /etc/apache2 httpd.conf I have: DirectoryIndex index.html index.php SetHandler python-program PythonHandler

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread Michael
Hey gang; Wow a lotof people are all having the same problem. Somehow the conversation I had with the original poster got taken off the list. Here is the next message I sent: chmod would change the permissions, but hede a little caution here; opening up your home directory allows everyone to get

Re: Custom ID field with random string

2008-04-06 Thread Erik Vorhes
I'm not sure how this is more transparent. Don't you mean *less* transparent for your user? Instead of a simple number (or more usable user-defined slug), you're giving them a random string, which will be almost impossible to remember and contains no discernibly useful information. If you

Re: Cycle Tag Question

2008-04-06 Thread Kevin Monceaux
Django Fans, On Sat, 5 Apr 2008, Kevin Monceaux wrote: > When used inside a loop is there any way to have the cycle tag simply > cycle through the given strings/variables each time it's called regardless > of the loop index? > I tried placing a {% cycle 'Odd' 'Even' as rowcolors %} outside

Making user emails unique

2008-04-06 Thread Julien
Hi, I've implemented a backend to let users authenticate with their email instead of their username, and that works quite well. However, for security and piece of mind I'd like to: 1) Make sure that emails are unique. According to the thread [1] there's no straight forward solution other than

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread keith
Exact same issue here. Tried everything listed. Any other ideas or possibly a sample config for httpd.conf on ubuntu. Thanks in advance for your help -Original Message- From: Will Boyce <[EMAIL PROTECTED]> Sent: Sunday, April 6, 2008 3:23am To: Django users

Re: CheckboxSelectMultiple under modelform

2008-04-06 Thread Iamnewbie
Thanks.Malcolm After using self.fields['condition'].widget=forms.CheckboxSelectMultiple() instead of self.fields['condition'].widget=forms.CheckboxSelectMultiple No error shows, but nothing shows about field condition on the form. I am totally new to django, could you please tell me more?

Re: Custom ID field with random string

2008-04-06 Thread Julien
Ok, I see. In fact I'd be happy to reduce it to 12 characters instead of 36, as long as it's enough to store all my data. But since it's enough for YouTube I guess that'd be enough for me. 1) So, should I only save the farthest right characters (i.e '42665d440a17' in the following example)?

TestCase: problem with returning posted data, it returns excepted data instead

2008-04-06 Thread Tony
I am testing my view using the Client(), and I am having trouble retrieving a variable that is in a try and except block. It is not returning the posted item in the block, but instead always returning the excepted data. Here is the snippet I am trying to test in my view.py: """

Re: Same Name; Different People

2008-04-06 Thread LRP
On Apr 6, 2:08 am, Michael <[EMAIL PROTECTED]> wrote: > Not really following you here. The default layout of django auth is that you > can have 100 people of the same name in multiple entries unaware that there > is another person with the same name unless they try to make a username the > same.

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread Graham Dumpleton
On Apr 6, 5:23 pm, Will Boyce <[EMAIL PROTECTED]> wrote: > Assuming your django project (mysite) is in /home/webmaster/ > public_html/django/ then you'll want a trailing "/" in your > PythonPath. No you don't. Trailing slash shouldn't make any difference. What gives you that idea? Graham >

http://www.replica-ebags.com I Bouvier Suede Hobo Bag Handbag

2008-04-06 Thread replica watch
Our products as below: http://replica-ebags.com/Replica_Wallets_1.html http://replica-ebags.com/Fashion_Jewelrys_RFJ0803219.html http://replica-ebags.com/Replica_Louis_Vuitton_shoes_RLS0803013.html http://replica-ebags.com/Replica_Shoes_1.html louis vuitton monogram canvas Keepall 45 with

Re: Configure Mod_Python fo Django on Apache server on Ubuntu

2008-04-06 Thread Will Boyce
Assuming your django project (mysite) is in /home/webmaster/ public_html/django/ then you'll want a trailing "/" in your PythonPath. Hope this helps. On Apr 5, 9:53 pm, HangingClowns <[EMAIL PROTECTED]> wrote: > I should have the latest versions available for Apache and mod_python > cause I

Re: Mod_Python and Eggs

2008-04-06 Thread Graham Dumpleton
On Apr 4, 11:37 pm, mike <[EMAIL PROTECTED]> wrote: > I had this issue and was able to correct it by adding the following to > my settings.py > > import os > os.environ['PYTHON_EGG_CACHE'] = '/tmp' > > Hope this helps somebody Using '/tmp' as the Python egg cache is actually not a good idea.

Re: Memory Usage/Optimization Question

2008-04-06 Thread Graham Dumpleton
On Apr 6, 2:30 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Also, if you haven't already, I'd definitely recommend switching to > mod_wsgi. I'm in the same boat as you - django apps on webfaction, > running up against memory limits (to the point where I was getting my > sites shut

Project Topology

2008-04-06 Thread aaronblew
Hi all, So I'm in the middle of thinking about my first Django project. The project will have different sections for the end-user to access like Customer Information, Store and Checkout, for example. Should these "sections" of the Project be divided up into different applications or should they

Re: Same Name; Different People

2008-04-06 Thread Michael
Not really following you here. The default layout of django auth is that you can have 100 people of the same name in multiple entries unaware that there is another person with the same name unless they try to make a username the same. Django, and most high level frameworks work so they increment