Re: Django using 2 DB

2009-10-30 Thread Gustavo Henrique
Thanks Russ! How I create a combobox in ModelForm contains data from other database? for exemple: class Client(models.Model): group = models.IntegerField() # this contains a id from another DB ... class ClientForm(ModelForm): group = ModelChoiceField(queryset=???) class Meta:

Fwd: Twisted WSGI (trunk) + Django 1.1.1 + Pinax Twisted WSGI setup == broken forms?

2009-10-30 Thread sstein...@gmail.com
Hi! I've been pulling my hair out all day... I have a Django 1.1.x project running under Twisted Trunk (27392) using WSGI. I've been having mega-problems with forms not showing up in Django's REQUEST object so I decided to nail it down to the simplest case. I

Re: SOLVED Is there a way to just submit a simple form? -- Mis-nested tags break things!

2009-10-30 Thread sstein...@gmail.com
On Oct 30, 2009, at 10:00 PM, Mike Ramirez wrote: > On Friday 30 October 2009 18:44:02 sstein...@gmail.com wrote: >> Normally validation is the first thing I check but the w3c validator >> can't validate localhost addresses so I had to use the old "cut & >> paste" method to submit my HTML. > >

RE-UN-SOLVED Is there a way to just submit a simple forms?

2009-10-30 Thread sstein...@gmail.com
It actually turns out that there is appears to be a bug serving the application under Twisted where normal forms are not being properly reflected in Django's REQUEST object. When I 'solved' the problem, I was running under the development server (since it nicely restarts itself on code

Re: SOLVED Is there a way to just submit a simple form? -- Mis-nested tags break things!

2009-10-30 Thread Colin Bean
On Fri, Oct 30, 2009 at 7:00 PM, Mike Ramirez wrote: > On Friday 30 October 2009 18:44:02 sstein...@gmail.com wrote: >> Normally validation is the first thing I check but the w3c validator >> can't validate localhost addresses so I had to use the old "cut & >> past" method to

Re: SOLVED Is there a way to just submit a simple form? -- Mis-nested tags break things!

2009-10-30 Thread Mike Ramirez
On Friday 30 October 2009 18:44:02 sstein...@gmail.com wrote: > Normally validation is the first thing I check but the w3c validator > can't validate localhost addresses so I had to use the old "cut & > past" method to submit my HTML. > > Thanks, > > S > If it's important to you, you can

SOLVED Is there a way to just submit a simple form? -- Mis-nested tags break things!

2009-10-30 Thread sstein...@gmail.com
On Oct 30, 2009, at 8:58 PM, Karen Tracey wrote: > On Fri, Oct 30, 2009 at 8:30 PM, ssteinerX > wrote: > > Hi! > I'm trying to submit a simple: > > Subject: type="text" name="subject" maxlength="100" /> > > > > type form but when I submit, it's nowhere to be found in

Re: Django using 2 DB

2009-10-30 Thread Russell Keith-Magee
On Sat, Oct 31, 2009 at 12:34 AM, Gustavo Henrique wrote: > > Hi! > I have a project using mysql and it have to access a firebird BD for > get data. > What the better way to use 2 databases in django? What you recommend > me to do? Maybe SQLAlchemy? Right now, Django

Re: Is there a way to just submit a simple form?

2009-10-30 Thread Karen Tracey
On Fri, Oct 30, 2009 at 8:30 PM, ssteinerX wrote: > > Hi! > I'm trying to submit a simple: > > Subject: type="text" name="subject" maxlength="100" /> > > > > type form but when I submit, it's nowhere to be found in the REQUEST > object (GET or POST) that I've been able

Re: Is there a way to just submit a simple form?

2009-10-30 Thread Sumanth
Hi Steve, It should be found in request.REQUEST['foo'] Try that Sumanth On Oct 30, 5:30 pm, ssteinerX wrote: > Hi! >   I'm trying to submit a simple: > > Subject: type="text" name="subject" maxlength="100" /> >   > > >   type form but when I submit, it's nowhere to be

Is there a way to just submit a simple form?

2009-10-30 Thread ssteinerX
Hi! I'm trying to submit a simple: Subject: type form but when I submit, it's nowhere to be found in the REQUEST object (GET or POST) that I've been able to find. Where does it go? I have no problems with regular Django forms, but this is a legacy app I'm moving and I don't want

Re: My Dear Children

2009-10-30 Thread James Matthews
Quiet annoying! On Fri, Oct 30, 2009 at 3:51 AM, Russell Keith-Magee wrote: > > On Fri, Oct 30, 2009 at 6:18 PM, Crispin Wellington > wrote: > > > > In my book, posting this kind of thing to a mailing list not about > > religion

Re: runaway apache takes up all of swap

2009-10-30 Thread Leo Shklovskii
This problem turned out to be an application issue. I am using GeoDjango and calling buffer() with a negative value which caused problems on certain polygons for the underlying GEOS library. Thanks to everyone who responded off list. -- --Leo On Fri, Oct 30, 2009 at 8:48 AM, Leo Shklovskii

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Anthony Simonelli
On Fri, Oct 30, 2009 at 2:58 PM, Anthony Simonelli wrote: > On Fri, Oct 30, 2009 at 10:58 AM, Tom Evans wrote: >> When you iterate through the fieldset, you should be iterating through form >> instances. Because they are forms from a

Re: GROUP results in views.py

2009-10-30 Thread Javier Guerra
On Fri, Oct 30, 2009 at 4:05 PM, TiNo wrote: > SQL's GROUP BY is made for this isn't it? no, it's not. SQL's GROUP BY discards 'individual' rows off the result, showing only 'grouping' rows. -- Javier --~--~-~--~~~---~--~~ You received this

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Bill Freeman
On Fri, Oct 30, 2009 at 4:36 PM, Preston Holmes wrote: > > > > On Oct 30, 12:00 pm, Bill Freeman wrote: >> Yet another option is to write a widget that subclasses the existing >> one, and adds >> disabled='disabled' to the dictionary that will be used to

Re: calendar button missing on admin pages

2009-10-30 Thread andylytical
FIXED! Found the problem from this post: http://groups.google.com/group/django-users/browse_thread/thread/7ff96003bed5ca5c/6950d58ae914d1d4?lnk=gst=apache+javascript#6950d58ae914d1d4 Summary: In my apache config, I was using , which matches more than anticipated because it wasn't anchored to the

Re: GROUP results in views.py

2009-10-30 Thread TiNo
On Fri, Oct 30, 2009 at 15:05, Tom Evans wrote: > SQL cant do this, so do it in python... SQL's GROUP BY is made for this isn't it? And it is also possible in django. I guess this is what you need:

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Preston Holmes
On Oct 30, 12:00 pm, Bill Freeman wrote: > Yet another option is to write a widget that subclasses the existing > one, and adds > disabled='disabled' to the dictionary that will be used to populate > the attributes > (usually the 'attrs' argument, I think, and you will have

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Anthony Simonelli
On Fri, Oct 30, 2009 at 10:58 AM, Tom Evans wrote: > When you iterate through the fieldset, you should be iterating through form > instances. Because they are forms from a ModelFormSet, they will be > ModelForm instances, and so will have an instance attribute that you

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Bill Freeman
Yet another option is to write a widget that subclasses the existing one, and adds disabled='disabled' to the dictionary that will be used to populate the attributes (usually the 'attrs' argument, I think, and you will have to handle the possibility that you will be passed None instead of a

Re: pdb doesn't break in django

2009-10-30 Thread Bill Freeman
It works for me. Maybe you're not getting to those statements? Another module of the same name on the path being imported instead? When I stick it in a view function and it doesn't hit it's usually because I've botched urls.py. Try putting them at top level in the module, in which case it

I think there is something wrong with Django request.FILES

2009-10-30 Thread NitinHayaran
Hi, I have seen a peculiar behavior while uploading files using flash uploader. (fancy uploader). When I use following function for uploading files it always gives me error in Flash saying : "Error caused a send or load operation to fail (Error #2038)" def upload_notes(request): ret =

pdb doesn't break in django

2009-10-30 Thread skunkwerk
Hi, i've been trying to use pdb inside my django code, but it never breaks the program flow. I insert this into my code: import pdb pdb.set_trace() but it just continues execution - is there something i need to be doing? thanks! --~--~-~--~~~---~--~~ You

Template processing/pre-processing

2009-10-30 Thread rd-london
Hi, I'd like to write some code, probably middleware, that look at various types of HTML in templates and prepends a setting from settings.py. For example, I'd like to pickup all .js, .css, .jpg, .png, .gif - and stick a custom setting from settings.py on the front - effectively a path.

Re: Darpa challenge

2009-10-30 Thread Joshua D. Drake
On Fri, 2009-10-30 at 14:09 +0100, Thomas Guettler wrote: > > > Adam Nelson wrote: > > All, > > > > In case people hadn't heard, DARPA just announced what I think is the > > coolest competition ever: > > > > http://networkchallenge.darpa.mil/ > > > > On December 5, DARPA will raise 10 red

Django using 2 DB

2009-10-30 Thread Gustavo Henrique
Hi! I have a project using mysql and it have to access a firebird BD for get data. What the better way to use 2 databases in django? What you recommend me to do? Maybe SQLAlchemy? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed

django admin page missing icons.....

2009-10-30 Thread William Chan
I have a fedora 9 linux web server box. I compiled php and apache. It has the python 2.5.1 rpm's that came with fedora 9. Now I have to support django on my web server. I compiled mod_python and installed the django rpm's that come with fedora 9 ( version 1.0.2 final ). I followed the tutorial

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Tom Evans
When you iterate through the fieldset, you should be iterating through form instances. Because they are forms from a ModelFormSet, they will be ModelForm instances, and so will have an instance attribute that you can use to output the fields you don't want in the form. You can then restrict the

comments : error messages not in page layout

2009-10-30 Thread Niels
Hello, I implemented the comments module. When all fields properly field and after a post everything is fine. Still on the same page. But when I don't enter all fields I get another page with the error messages not in the current page.

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread pjrhar...@gmail.com
On Oct 30, 5:47 am, Anthony Simonelli wrote: > Is there any way to display the fields as text rather than as input fields? My suggestion would be to write your own widget that simply renders as text, and make all the uneditable fields use that widget. Have a look in the

runaway apache takes up all of swap

2009-10-30 Thread Leo Shklovskii
I've got a strange problem that I've been trying to figure out over the past few days with apache suddenly taking up 100% of memory and swap, effectively killing the server. The setup is: Ubuntu Jaunty (fully updated) nginx/0.6.35 serving static and proxying to: Apache/2.2.11 (Ubuntu) mod_wsgi

Re: Multiple sites, multiple databases, one Django installation? Middleware?

2009-10-30 Thread Stodge
I didn't realise there was a "settings" option for syncdb - it works beautifully! I now have multi site with multiple databases and one application installation! Cool... On Oct 30, 11:29 am, Stodge wrote: > Oops - this might be what I need: > > SetEnv DJANGO_SETTINGS_MODULE

Re: Multiple sites, multiple databases, one Django installation? Middleware?

2009-10-30 Thread Stodge
Oops - this might be what I need: SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings So I created my new settings file that points to a different database and made a new Apache alias to the new virtual Django site that I want (so /django/fred instead of just /django). But how do I sync this

Re: Multiple sites, multiple databases, one Django installation? Middleware?

2009-10-30 Thread Stodge
Sorry, forgot to say that is with mod_python. On Oct 30, 10:48 am, Stodge wrote: > Just wondering whether I could write a middleware that parsed > request.path, say: > > /django/site1/index > > extracted and removed the site name as "site1" and switched the > settings on the

Multiple sites, multiple databases, one Django installation? Middleware?

2009-10-30 Thread Stodge
Just wondering whether I could write a middleware that parsed request.path, say: /django/site1/index extracted and removed the site name as "site1" and switched the settings on the fly to use settings_site1.py instead. settings_site1.py would use DB named "site1_db". Then it would process the

CheckboxSelectMultiple checked_by_default

2009-10-30 Thread james spencer
Hello group, first post for me! Anyone know the equivalent of checked_by_default for the CheckboxSelectMultiple widget? I'm using it like so: myinput = forms.MultipleChoiceField( choices=((OPTIONONE, 'option1'),(OPTIONTWO, 'option2')), required=False,

Re: best approach for using email as username

2009-10-30 Thread Subramanyam
small correction On Fri, Oct 30, 2009 at 7:41 PM, Subramanyam wrote: > Hi > > Firstly you can try using the following auth-backend > http://www.djangosnippets.org/snippets/74/ > > secondly > while rendering the signup form to the user > you can write a clean method in your

Re: best approach for using email as username

2009-10-30 Thread Subramanyam
Hi Firstly you can try using the following auth-backend http://www.djangosnippets.org/snippets/74/ secondly while rendering the signup form to the user you can write a clean method in your signnup form like def clean_email(self): try:

Re: GROUP results in views.py

2009-10-30 Thread Tom Evans
SQL cant do this, so do it in python... items = ItemOwned.objects.filter(user=id) data = { } for item in items: cur_set = data.get(item.setId, {'setId': item.setId, 'items':[]}) cur_set['items'].append({'id': item.id, }) data[item.setId] = cur_set return

Re: best approach for using email as username

2009-10-30 Thread wancharle sebastiao quirino
Hi, The unique problem is username = email. You could create auth backend for login with email but email != username I use: http://code.google.com/p/django-profile/ In django-profile login is with username and email is opcional... But i add email auth backend and user can login with your

Re: Darpa challenge

2009-10-30 Thread Thomas Guettler
Adam Nelson wrote: > All, > > In case people hadn't heard, DARPA just announced what I think is the > coolest competition ever: > > http://networkchallenge.darpa.mil/ > > On December 5, DARPA will raise 10 red weather balloons somewhere in > the US. The first person to get the location of

Problem using django with fancy uploader

2009-10-30 Thread NitinHayaran
Hi, I am facing problem in using Fancyuploader http://digitarald.de/project/fancyupload/ along with django. The fancy uploader is working fine with PHP backend but when it is coming with django its throwing error. Upload failed: Error caused a send or load operation to fail (Error #2038) Has

request.get_full_path() vs REQUEST_URI

2009-10-30 Thread Thomas Guettler
Hi, I have a middleware that checks if URLs are broken. I discovered that request.get_full_path() removes double slashes. Unfortunately REQUEST_URI is optional. For example, it is not set by the test client of django. Is there a way to get the real URL, like seen by the user in the browser,

Re: GROUP results in views.py

2009-10-30 Thread The Danny Bos
Any ideas anyone? I'm completely stumped ... On Oct 30, 12:59 pm, The Danny Bos wrote: > If helpful, here's the table structure. > > class ItemOwned(models.Model): >         user = models.ForeignKey(User) >         item = models.ForeignKey(Item) > > class

Re: My Dear Children

2009-10-30 Thread Russell Keith-Magee
On Fri, Oct 30, 2009 at 6:18 PM, Crispin Wellington wrote: > > In my book, posting this kind of thing to a mailing list not about > religion constitutes a one way ticket to hell. FYI - django-users is a moderated mailing list, but Google Groups is currently

Re: Help in understanding URL Namespaces

2009-10-30 Thread Russell Keith-Magee
On Fri, Oct 30, 2009 at 6:03 PM, Continuation wrote: > > I'm new to Django. Having a great time learning from the doc. > > Normally the doc explains the topics in hand very clearly. But on 1 > subject I'm still confused after going over the doc: URL Namespaces. > > Can

Re: My Dear Children

2009-10-30 Thread Crispin Wellington
In my book, posting this kind of thing to a mailing list not about religion constitutes a one way ticket to hell. Crispin Wellington On Fri, 2009-10-30 at 15:19 +0530, vivian gonsalves wrote: > My dear children, I write this to you so that you will not sin. But if > anybody does sin, we have

Re: Trouble accessing session data from a template

2009-10-30 Thread Marco
On Oct 29, 9:04 pm, Daniel Roseman wrote: > On Oct 29, 5:32 pm, Marco wrote: > > > > > Hi all, > > > I going a little bit crazy that's why I'm posting here ... > > > I have a view : > > > def index(request): > >    request.session['hello'] =

Help in understanding URL Namespaces

2009-10-30 Thread Continuation
I'm new to Django. Having a great time learning from the doc. Normally the doc explains the topics in hand very clearly. But on 1 subject I'm still confused after going over the doc: URL Namespaces. Can someone explain to me what URL Namespaces is for and how does it work? Any external articles

My Dear Children

2009-10-30 Thread vivian gonsalves
My dear children, I write this to you so that you will not sin. But if anybody does sin, we have one who speaks to the Father in our defense—Jesus Christ, the Righteous One. 2 He is the atoning sacrifice for our sins, and not only for ours but also for the sins of the whole world. 1 John 2:1-2

Re: Interrelated form fields

2009-10-30 Thread bruno desthuilliers
On 29 oct, 18:33, Daniel Roseman wrote: > On Oct 29, 4:42 pm, bruno desthuilliers > wrote: > > (FWIW and IIRC, the appropriate english term is 'Customer' - please > > someone correct me if I'm wrong) > > OK... the French word 'client'

Re: generic views vs writing my own

2009-10-30 Thread bruno desthuilliers
On 29 oct, 17:51, Ross wrote: > For which cases would a user wish to write their own views rather than > using generic views? I'd rather formulate this the other way round : for which cases would you use generic views rather than your own ? And the answer is obvious :

Re: Django Model inheritance and foreignkeys

2009-10-30 Thread bruno desthuilliers
On 29 oct, 23:49, Andew Gee wrote: > Hi, > > I have the following models > >     class Person(models.Model): >       name = models.CharField(max_length=100) > >     class Employee(Person): >       job = model.Charfield(max_length=200) > >     class

Re: Dependencies Among Dropboxes

2009-10-30 Thread Mike Ramirez
On Thursday 29 October 2009 22:33:27 Brett wrote: > Hey all, I'm writing a small internal website for a lab, trying to > create a system to organize our various genes/proteins etc. Since we > only use a small number of bacteria and strains, I wanted to offer the > user a series of drop boxes -

calendar button missing on admin pages

2009-10-30 Thread andylytical
Anyone have any ideas why this is broken or thoughts on where to troubleshoot further? I tend to assume something this basic has to user error, but I can't find any reason why the calendar and time javascript selection buttons are missing from my admin pages for the datetime fields. I've

Dependencies Among Dropboxes

2009-10-30 Thread Brett
Hey all, I'm writing a small internal website for a lab, trying to create a system to organize our various genes/proteins etc. Since we only use a small number of bacteria and strains, I wanted to offer the user a series of drop boxes - one for the species, another for the strain, etc. But what

Re: Specifying Django Project/Application Templates

2009-10-30 Thread Johan
Good day Thanks for the reply. This is exactly the approach which I am going to take. I have already started my own command. I am hoping to do it in such a fashion that other people can benefit from it. Thanks. On Oct 29, 6:57 pm, Mike Ramirez wrote: > On Thursday 29