Re: __init__() got an unexpected keyword argument 'max_digits'

2007-06-28 Thread Malcolm Tredinnick
On Thu, 2007-06-28 at 12:06 -0700, adamjspooner wrote: > Hello all, > > I'm adding a DecimalField to a preexisting app: > > foo_bar = models.DecimalField(max_digits=5, decimal_places=2, > blank=True, null=True, default=0.0, unique=True) > > I've added a row in the table: > > foo_bar

Using newforms to create multiple related objects?

2007-06-28 Thread Michael Sylvan
Hello, I am trying to use newforms and templates, together with the following models, to mimic what the admin application does with num_in_admin : provide a form for Person's fields, and multiple Phone forms. With just one Phone form things are quite straightforward: validate the Person form,

Re: Searching for strings and URLconfs

2007-06-28 Thread Malcolm Tredinnick
On Thu, 2007-06-28 at 18:46 +, Ryan K wrote: > Hi. I'm trying to setup an re pattern for /search in my URL conf. How > can I match an entire string like "red fox" e.g. > http://example.com/django/search/red%20fox? > I noticed that Google replaces their query parameter q's spaces with > '+'s

Re: Newforms makes unicode String from a dictonary

2007-06-28 Thread Malcolm Tredinnick
On Thu, 2007-06-28 at 17:57 +0300, Alexander Pugachev wrote: > I still have them as unicode strings in [5559] Then please file a ticket with a simple example showing how to repeat the problem so this doesn't get forgotten. I can't repeat this (I obviously tested the first attempt at a fix).

Re: One-to-one relationship (model inheritance) or generic relations?

2007-06-28 Thread Russell Keith-Magee
On 6/28/07, Jamie Pittock <[EMAIL PROTECTED]> wrote: > > I don't want to code myself into a corner, so when I start looking at > features such as allowing users to search all venues would I be best > with one parent model or will I be ok keeping them separate? The > different types of venues

Re: Admin for Table of Foreign Keys

2007-06-28 Thread Russell Keith-Magee
On 6/28/07, JimR <[EMAIL PROTECTED]> wrote: > > below. When I include the 'def __str__(self)' it displays the user id > in the admin interface, but when I access the record I get an error > "__str__ returned non-string (type Userid)" The error message is telling you the exact problem. Your

Re: Variables available to all templates

2007-06-28 Thread Derek Hoy
Take a look at this: http://www.djangoproject.com/documentation/authentication/#authentication-data-in-templates You can use this to put something in a base template that all your site templates can be based on. Derek --~--~-~--~~~---~--~~ You received this

Re: Variables available to all templates

2007-06-28 Thread Vincent Nijs
Do you want to show the user all your content without authentication? Why not just use @login_required decorator to have then login when needed? Below are the commands you need. from django.contrib.auth.decorators import login_required @login_required def myfunction(request): # do stuff

Re: django authorization of apache

2007-06-28 Thread Graham Dumpleton
Look at the FastCgiAuthenticator directive for mod_fastcgi module. The FASTCGI protocol does have mechanisms for allowing backend process to do the authentication, but have no idea how it used or whether it would work. Graham On Jun 29, 12:13 am, Robin Becker <[EMAIL PROTECTED]> wrote: > I see

Variables available to all templates

2007-06-28 Thread Kirk Strauser
Is there a list of variables that all templates can access? I'm asking out of general interest, but the problem I'm trying to solve is that I want to have a "login" or "logout" link on every page of the site, depending on whether a visitor is currently authenticated, and I don't want to have to

crosstabs

2007-06-28 Thread Matthew Nuzum
I've recently deployed my first non-trivial (by my standards) world accessible django app. Its not perfect. However, there comes a point when you just have to get'er done, and so it is. I bugged a lot of people on #django and got some good feedback, but just couldn't communicate my question well

Re: AttributeError: 'bool' object has no attribute 'get'

2007-06-28 Thread [EMAIL PROTECTED]
thanks James! i just applied the fix manually since it was so small, and it did the trick. i'm sure looking forward to multi-db catching up to trunk... :) On Jun 28, 3:41 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 6/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > i'm using

Re: AttributeError: 'bool' object has no attribute 'get'

2007-06-28 Thread James Bennett
On 6/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i'm using 0.96pre, the multi-db branch. The bug was in the oldforms system, and has been fixed in trunk and in the older releases we maintain support for; the multi-db branch went stagnant for a long time, and is only now being picked up

Re: Searching for strings and URLconfs

2007-06-28 Thread Ryan K
Note - I know that I am not using a parameter and it's much easier to do that (I was searching without having created the form yet so this slipped my mind). But how would you capture something like "red fox" in a URLconf pattern? On Jun 28, 2:46 pm, Ryan K <[EMAIL PROTECTED]> wrote: > Hi. I'm

AttributeError: 'bool' object has no attribute 'get'

2007-06-28 Thread [EMAIL PROTECTED]
see http://dpaste.com/13161/ the error pops up when i try to edit a single User in the admin interface. when i remove those two lines i marked in the second model, it works ok. i'm using 0.96pre, the multi-db branch. i hope you can help! thanks in advance.

Re: Password Logistics Help Needed

2007-06-28 Thread James Bennett
I wrote a quick off-list reply to this last night, but thought it might be worth pointing out parts of it publicly as well so anyone who searches the archives with similar problems will spot this: 1. Django does still support plain old unsalted md5 passwords for login (for backwards

Re: django authorization of apache

2007-06-28 Thread Steven Armstrong
Robin Becker wrote on 06/28/07 19:44: > Steven Armstrong wrote: >> Robin Becker wrote on 06/28/07 16:13: >>> I see from this documentation >>> >>> http://www.djangoproject.com/documentation/apache_auth/#configuring-apache >>> >>> that it is conceptually possible to configure apache authorization

__init__() got an unexpected keyword argument 'max_digits'

2007-06-28 Thread adamjspooner
Hello all, I'm adding a DecimalField to a preexisting app: foo_bar = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, default=0.0, unique=True) I've added a row in the table: foo_bar DECIMAL(5,2) UNI NULL; But when I try to syncdb or even validate the app I get:

Re: Announcing the birth of Fluther.com

2007-06-28 Thread Andrew
Thanks for the compliments, Leif! We're running a LAMP VPS (currently with ServerAxis). We use memcache (right now our traffic doesn't warrant mutliple servers or squid). We use the built-in django default user paired with a custom userprofile as detailed in the b-list article. Thanks for

Searching for strings and URLconfs

2007-06-28 Thread Ryan K
Hi. I'm trying to setup an re pattern for /search in my URL conf. How can I match an entire string like "red fox" e.g. http://example.com/django/search/red%20fox? I noticed that Google replaces their query parameter q's spaces with '+'s using Javascript. Is that a better way to go? Thanks.

Re: nasa site on django

2007-06-28 Thread Jacob Kaplan-Moss
On 6/28/07, Vance Dubberly <[EMAIL PROTECTED]> wrote: > Django suffers from running under mod_python in > a prefork environment where every process loads a full copy of django. So > as I'm sure you can imagine RAM gets chewed up very quickly. Are you running Django behind a load balancer like

RE: test client login problems

2007-06-28 Thread Chris Brand
> > Ahhh. So after I've used login() once in a test, get() will pass the > > existing session cookie, in which case my test to retrieve two pages > while > > logged in would look like : > > client.login(...) > > client.get(...) > > Does that sound right ? I'll try that later today. > > Sounds

Re: nasa site on django

2007-06-28 Thread Jeremy Dunck
On 6/28/07, Vance Dubberly <[EMAIL PROTECTED]> wrote: > However resource intensity is a very big deal. RAM is a huge factor > here. Thanks for clearing up the issue. It's true that the process-per-request model is heavier in terms of RAM than alternatives, but it's generally fast. Maybe

Re: newforms, form.save(), and getting the object I just saved

2007-06-28 Thread [EMAIL PROTECTED]
Yup, I'm suing form_for_model. I guess when I assigned it to foo (foo=form.save()), then I was really assigning the returned object to foo and that's how I can reference what I want from foo. On Jun 28, 10:00 am, Doug B <[EMAIL PROTECTED]> wrote: > If you are using the helper functions like

Re: nasa site on django

2007-06-28 Thread Vance Dubberly
Jeremy, I don't know about Java vs Python speeds. I've little doubt Java is alot faster if for no other reason than the amount of resources Sun puts behind it. However resource intensity is a very big deal. RAM is a huge factor here. The Tomcat App was running in a VM limited 256 meg and

Re: django authorization of apache

2007-06-28 Thread Robin Becker
Steven Armstrong wrote: > Robin Becker wrote on 06/28/07 16:13: >> I see from this documentation >> >> http://www.djangoproject.com/documentation/apache_auth/#configuring-apache >> >> that it is conceptually possible to configure apache authorization using >> django. >> >> However, we have

Django is great, but where are the coders at

2007-06-28 Thread mjhaver
I'm a technical recruiter, but I also just love technology. I like to get involved with companies doing interesting things especially with open source. The problem is it's hard to find people that work with those technologies. I'm currently working with a cutting edge Internet Marketing and

Re: nasa site on django

2007-06-28 Thread Vance Dubberly
No dynamically assembling the pages via django is faster than serving static files off disk with Apache. Vance On 6/27/07, KpoH <[EMAIL PROTECTED]> wrote: > > > I don't understand. Static files served by django? > > Vance Dubberly wrote: > > Moved http://opensource.arc.nasa.gov to django a couple

Re: nasa site on django

2007-06-28 Thread Vance Dubberly
Kai, Very very untrue. RAM is much faster than Disk IO. Dynamically assembling a page from query results cached in database memory is far faster than going to disk. Caching the rendered page via memcached, squid, or even in a database table is so much faster than serving static disk bound

Re: Newbie Question - How do I get my burger and fries from BK and not Mickey D's?

2007-06-28 Thread Wiley
I may not totally understand what you are suggesting here - I can use javascript to manipulate the data that's already on the page, but I want to filter the choices displayed to me using information that I have to get out of the database...will put js on that particular admin page do the trick?

Re: Customize change_list using a filter

2007-06-28 Thread Vincent Nijs
If you want to use the admin page, you can add the following into your model class. class Admin: list_display('cars') list_filter = ('cars') If you want to create a custom page outside of admin then it is a little more difficult (for me at least :) ). I made a page like

Re: Can't run Django. Getting error message about no module named _md5

2007-06-28 Thread Rob Hudson
Python 2.5 uses hashlib and no longer has a module "md5". There's at least 1 patch dealing with this for users and passwords: http://code.djangoproject.com/ticket/3604 Though the "_md5" doesn't seem right either. -Rob On Jun 27, 6:58 am, jeffself <[EMAIL PROTECTED]> wrote: > Just updated

Re: Re-rendering same page

2007-06-28 Thread Jeremy Dunck
On 6/28/07, Doug B <[EMAIL PROTECTED]> wrote: > > Are you sure the request is actually being made, and not ignored by > the browser? If you do GETs to the same url with the same parameters If you do requests that have side effects, you shouldn't be using GET. Consider POST.

Re: nasa site on django

2007-06-28 Thread Jacob Kaplan-Moss
On 6/27/07, Vance Dubberly <[EMAIL PROTECTED]> wrote: > Moved http://opensource.arc.nasa.gov to django a couple of weeks ago. > Thought ya'll might want to know that. Congrats :) > Also thought you might want to know the site was running on Tomcat/Mysql and > the performance difference is mind

Re: Re-rendering same page

2007-06-28 Thread Doug B
Are you sure the request is actually being made, and not ignored by the browser? If you do GETs to the same url with the same parameters (your boolean I assume) the browser will simply ignore the request. I ran into that trying to do some ajax stuff, and ended up appending a timestamp number as

Re: newforms, form.save(), and getting the object I just saved

2007-06-28 Thread Doug B
If you are using the helper functions like form_for_model, form.save() should return the saved object. The helper functions build the save method for you based on the model definition. If you are doing custom forms, it's up to you to make the form.save() method to handle the form->model

Re: Newforms makes unicode String from a dictonary

2007-06-28 Thread Alexander Pugachev
I still have them as unicode strings in [5559] 2007/6/11, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > On Mon, 2007-06-11 at 11:39 +, Christian Schmidt wrote: > > I use at this time the ugly version with eval(). I really don't know > > how ugly it is. Can I have problems if there is python

Re: newforms, form.save(), and getting the object I just saved

2007-06-28 Thread [EMAIL PROTECTED]
Nevermind. I just needed to have foo = form.save(), and then I can access foo. On Jun 28, 8:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Using newforms, I do form.save(), and then need to get the object I > just saved. How can I do this? > > Here's the flow: > > User submits form. If

Admin for Table of Foreign Keys

2007-06-28 Thread JimR
I have a table that consists entirely of foreign keys. I'd like to display the User Id (and possibly retrieve and display the person's name from another table?) in the admin interface. The model is below. When I include the 'def __str__(self)' it displays the user id in the admin interface,

Customize change_list using a filter

2007-06-28 Thread Diego
Hi, I'm using the admin interface, I need use a change_list.html filtered. Example: Show only Ford cars Any ideas to do that?? Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

db backed dynamic forms

2007-06-28 Thread kingel
Hi all, Been reading this group for a while, decided to give an idea for dynamic forms a try after reading the article on dynamicmodels http://code.djangoproject.com/wiki/DynamicModels I cooked up a some models and a view see: http://statix.net/dynaform if one creates a form with some info

Re: django authorization of apache

2007-06-28 Thread Steven Armstrong
Robin Becker wrote on 06/28/07 16:13: > I see from this documentation > > http://www.djangoproject.com/documentation/apache_auth/#configuring-apache > > that it is conceptually possible to configure apache authorization using > django. > > However, we have recently decided to de-couple django

django authorization of apache

2007-06-28 Thread Robin Becker
I see from this documentation http://www.djangoproject.com/documentation/apache_auth/#configuring-apache that it is conceptually possible to configure apache authorization using django. However, we have recently decided to de-couple django from mod_python by using fastcgi. This is because we

Re: 'retrieve': the missing permission?

2007-06-28 Thread David Larlet
2007/6/28, David Larlet <[EMAIL PROTECTED]>: > 2007/6/26, David Larlet <[EMAIL PROTECTED]>: > > 2007/6/22, Chris Brand <[EMAIL PROTECTED]>: > > > > > > > > I just wonder why this permission is not part of the default > > > > > permissions (like add, change and delete)? > > > > > > > > > > David >

Re: 'retrieve': the missing permission?

2007-06-28 Thread David Larlet
2007/6/26, David Larlet <[EMAIL PROTECTED]>: > 2007/6/22, Chris Brand <[EMAIL PROTECTED]>: > > > > > > I just wonder why this permission is not part of the default > > > > permissions (like add, change and delete)? > > > > > > > > David > > > > > > > No more thoughts about that? I'm really

newforms, form.save(), and getting the object I just saved

2007-06-28 Thread [EMAIL PROTECTED]
Using newforms, I do form.save(), and then need to get the object I just saved. How can I do this? Here's the flow: User submits form. If valid, it's saved, and I need to take them to a review page. At this point, the object has an "active" boolean set to false. The review page needs a paypal

Re: pydoc problem

2007-06-28 Thread dailer
On Jun 28, 12:31 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-06-27 at 18:58 -0700, dailer wrote: > > I have a models.py module that I thought I would test pydoc on. So I > > try. > > > $ python manage.py shell > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC

Re: limit)choices_to and OneToOne field affecting admin

2007-06-28 Thread Joe
Found it. In line 745 and 746 in main.py in django/contrib/admin/ views if self.opts.one_to_one_field: qs = qs.complex_filter(self.opts.one_to_one_field.rel.limit_choices_to) What was the thought behind this, and why wouldn't this be optional? On Jun 28, 8:52 am, Joe

Re: Dynamic menus using ul and li

2007-06-28 Thread Chris Moffitt
A while back when I was trying to do a similar thing, someone mentioned using elementree to do this. I tried a bunch of other ways but in the end, elementree was the easiest way for me. If you'd like to see the template tag I created, you can see it here -

limit)choices_to and OneToOne field affecting admin

2007-06-28 Thread Joe
Hi, I have a model that has a OneToOneField to User and a limit_choices_to parameter set: class Profile(models.model): [---tab---] user = models.OneToOneField(User, limit_choices_to={'is_staff':True}) When I use this is_staff parameter, I can only see staff users when I log in to the Django

One-to-one relationship (model inheritance) or generic relations?

2007-06-28 Thread Jamie Pittock
I'm still new to Django so bear with me ;) I have models for different types of venues (Bars, Clubs, etc). Because for example, I'd like to use one Rating model across all these venue Models I'd presumed that I'd need a parent Venue Model, using some kind of one-to-one relationship (until model

Re: Fixtures for datetime fields using auto_now

2007-06-28 Thread Russell Keith-Magee
On 6/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm writing tests for an application, and I sort by update_time for > one model. Is it possible in my fixtures to set fixed times? Right > now, the update_time attribute is always almost "right now". If I try > to set it in my JSON

Re: gettatr() access to ManyToMany huuuge delay?

2007-06-28 Thread Russell Keith-Magee
On 6/28/07, grassoalvaro <[EMAIL PROTECTED]> wrote: > > text: 1.149759 > name: 0.017819 > - > > Can someone explain me, why when i'm doing gettatr(test, "text") > (ManyToMany) i have so long delay? That is django (not database) >

Re: gettatr() access to ManyToMany huuuge delay?

2007-06-28 Thread grassoalvaro
No, it doesn't depend on server. Like i said - this is django problem. On Jun 28, 1:37 am, l5x <[EMAIL PROTECTED]> wrote: > On Jun 27, 11:32 pm, grassoalvaro <[EMAIL PROTECTED]> wrote: > > > > > Here some code: > > - > > class

Re: Using more than one database in the project

2007-06-28 Thread Ben Ford
Hi There is a branch that supports multiple databases and I'm working on getting the merges I've made from trunk checked in at the moment... That's probably your best bet, watch this space! Ben On 28/06/07, AnaReis <[EMAIL PROTECTED]> wrote: > > > Hi! > As I said in previous posts I'm a newbie in

Using more than one database in the project

2007-06-28 Thread AnaReis
Hi! As I said in previous posts I'm a newbie in these django stuff. I'm creating a project that consists in a web based GUI for managing some databases. This project has several modules. The user is presented with a start page where it is possible to chose which database to manage. I have now

Re: Newforms Attribute Errors

2007-06-28 Thread robo
You tried, thanks! The errors I get come before any major piece of code. They come after some simple statements: OrderDetailForm = form_for_model(Order_Detail) f = OrderDetailForm() f.save() f.is_bound which means my 0.96-pre (not a typo :) ) version might not be up to the challenge of

Dynamic menus using ul and li

2007-06-28 Thread FrostedDark
What I need is a way to create nested menus using and with the data coming from a model. I need to be able to get the entire list: Home Some Category Page Even Deeper Another Deeper Page

Re: Forms and formating error messages

2007-06-28 Thread AnaReis
On Jun 27, 9:41 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-06-27 at 02:26 -0700, AnaReis wrote: > > Hi again, > > This is getting very frustrating because I can't make this work... > > This is exactly what I wrote in the files: > > In future, please remember that when you

Re: Problem with URL

2007-06-28 Thread AnaReis
On Jun 27, 9:42 pm, robo <[EMAIL PROTECTED]> wrote: > Yes, Alberto is right. > > Also, I ran into this problem a few days ago. Basically, after you > write your view processing like Alberto suggested, you need to do a > response redirect or HttpResponseRedirect and pass it "." (which is to >

Re: Password Logistics Help Needed

2007-06-28 Thread Bryan Veloso
> The original poster suggested adding a field called password_md5 to a > model that is an extension of User. It was never indicated that such a > field already existed. Ah, my bad. I misinterpreted. --~--~-~--~~~---~--~~ You received this message because you

Re: Password Logistics Help Needed

2007-06-28 Thread Malcolm Tredinnick
On Thu, 2007-06-28 at 05:37 +, Bryan Veloso wrote: > Alright. I tried looking in the actual source for any mention of > password_md5... and it no longer exists. The original poster suggested adding a field called password_md5 to a model that is an extension of User. It was never indicated