Crashing Default Manipulator with ForeignKey/ManyToMany Combo

2006-09-22 Thread Tyson Tate
I'm using Django 0.95 on MacOS X 10.4 using Python 2.4.3, sqlite 3.3.7, and py-sqlite 2.3.1. I have this model: http://paste.e-scribe.com/1653/ I did syncdb with a fresh sqlite database and logged in to the admin interface to add a new Event object. I filled in all the fields except for th

automatically fill in some fields of a form, storing authenticated user

2006-09-22 Thread Benedict Verheyen
I'm not sure how to do those tasks:1. For a model, i want to allow the user to import settings from anotherdatabase. For instance, they fill in a number and hit a link or button,then data is looked up in another database and some of these values are then filled in the form so that when the user cre

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-22 Thread limodou
On 9/22/06, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > I'm not sure how to do those tasks: > > 1. For a model, i want to allow the user to import settings from another > database. For instance, they fill in a number and hit a link or button, > then data is looked up in another database and som

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-22 Thread patrickk
thanks, I think I´ve got it now. the documentation of custom manipulators really lacks advanced examples. I don´t know how one should find out what you explained in the last few mails by reading the documentation. e.g., I´m quite sure that there´s no explanation of "_meta" in the documentatio

Ubuntu Dapper Drake installation question

2006-09-22 Thread Daniel
Hi, just a quick question: did anyone succeed in installing Django 0.95 on Ubuntu Dapper Drake? I install python and python-dev, as well as the python-setuptools and python-mysqldb packages (all Python 2.4) and downloaded Django and tried running # sudo python setup.py install The result was no

date filter OverflowError

2006-09-22 Thread spako
when i try use the date filter in my template with the value "1900-01-01 16:27:32.14+01" i get an overflow error. this seems to be because the date is outside the unix timestamp range. a) should this not fail silently? b) can the date filter be changed to handle any date? i'll gladly submit a p

two models -> one form -> addmanipulator

2006-09-22 Thread Ulrich Nitsche
hi, i have two models (tables) concerning user data which belong together. Now I would like to use one single form to display and edit these values. Is there a way to use one changemanipulator to do this? Or if this is not possible is there a way to use different changemanipulators at the same ti

Re: Sample code for progress bar using patch 2070?

2006-09-22 Thread [EMAIL PROTECTED]
I adapted UploadProgress.js to be used in the admin, so it latches on to the first form in the page if the js is loaded. To use uploadprogress load: django.middleware.upload.UploadStateMiddleware and django.middleware.upload.StreamingUploadMiddleware in this order. Then put this in your models

Re: Ubuntu Dapper Drake installation question

2006-09-22 Thread Maciej Bliziński
On Fri, 2006-09-22 at 11:56 +0200, Daniel wrote: > The result was not really what I liked, it told me my version of the > python-setuptools is to old, it needed version c1, but Dapper only has > a9 included. > > Is there any chance to get Django installed? I use development version of Django, in

filers into generic views

2006-09-22 Thread Allan Henderson
Hi all, Currently I have a setup whereby a user navigating to a product category is met with the list of products in that category using generic views. In urls.py I have the 'info_dicts' handling the categories so that in the generic view the correct category is presented to user. That a

Re: two models -> one form -> addmanipulator

2006-09-22 Thread limodou
On 9/22/06, Ulrich Nitsche <[EMAIL PROTECTED]> wrote: > > hi, > > i have two models (tables) concerning user data which belong together. > Now I would like to use one single form to display and edit these > values. > Is there a way to use one changemanipulator to do this? > Or if this is not possi

Re: Ubuntu Dapper Drake installation question

2006-09-22 Thread Michael Radziej
Daniel schrieb: > Hi, > > just a quick question: did anyone succeed in installing Django 0.95 on > Ubuntu Dapper Drake? I install python and python-dev, as well as the > python-setuptools and python-mysqldb packages (all Python 2.4) and > downloaded Django and tried running > > # sudo python set

Re: two models -> one form -> addmanipulator

2006-09-22 Thread Michael Radziej
limodou schrieb: > No, I think you cann't do this in django. You should use custom > manipulator for this. Hmm, I think you could use it like this: ... form1 = forms.FormWrapper(manipulator1, data1, errors1) form2 = forms.FormWrapper(manipulator2, data2, errors2) return render_to_response(templa

HTTP response-code for missing querystring?

2006-09-22 Thread Gábor Farkas
hi, imagine that you have a view function, that requires a parameter in the querystring. for example, it needs to have: http://foo.com/bla/?param=15 now, what should happen if it gets: http://foo.com/bla/ ? in this case, technically the user should not be able to have the url without the

Re: two models -> one form -> addmanipulator

2006-09-22 Thread Aidas Bendoraitis
Once I used this kind of way and it really works. It's only kind of tricky to decide, when to call validators for each of the manipulators and when to save, if there is a relationship between the two models, for example: 1. if A and B are not saved, how to validate B, that has to be related to A,

Re: HTTP response-code for missing querystring?

2006-09-22 Thread Malcolm Tredinnick
On Fri, 2006-09-22 at 15:28 +0200, Gábor Farkas wrote: [...] > in this case, technically the user should not be able to have the url > without the querystring, except if he is playing with the url :) > > i mean "what is the most standard-conformant and correct response"? > > http-404 certainly

Re: HTTP response-code for missing querystring?

2006-09-22 Thread Aidas Bendoraitis
Why not to return a custom notice without any error codes? If you still want to send a response error, I would choose from these depending on the situation, what you are implementing: 204 No Content 400 Bad Request 403 Forbidden Aidas Bendoraitis [aka Archatas] On 9/22/06, Gábor

Re: two models -> one form -> addmanipulator

2006-09-22 Thread limodou
On 9/22/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > Once I used this kind of way and it really works. It's only kind of > tricky to decide, when to call validators for each of the manipulators > and when to save, if there is a relationship between the two models, > for example: > 1. if A

Re: HTTP response-code for missing querystring?

2006-09-22 Thread Gábor Farkas
Malcolm Tredinnick wrote: > On Fri, 2006-09-22 at 15:28 +0200, Gábor Farkas wrote: > [...] >> in this case, technically the user should not be able to have the url >> without the querystring, except if he is playing with the url :) >> >> i mean "what is the most standard-conformant and correct re

Re: HTTP response-code for missing querystring?

2006-09-22 Thread Corey Oordt
I'm not sure I can appreciate why you would require a URL to have a query string. It seems to go against the anti-crufty URLs that Django is trying to avoid. Query strings, if I understand them correctly are really meant to provide a subset or context of an otherwise working page. So with

Getting the values from a Sparse Matrix in a template

2006-09-22 Thread Woolley
Hi, I was wondering how to read a sparse martrix in a django template. I can generate the matrix in the view function, but I cannot seem to get the results to come out. Basic assignment/ format below, not how it is really done though, but this is the effective result matrix[(1,0)] = 1 matrix

Re: Ubuntu Dapper Drake installation question

2006-09-22 Thread [EMAIL PROTECTED]
You could always just install the svn version cd /usr/lib/python2.4/site-packages svn checkout http://code.djangoproject.com/svn/django/trunk django --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Re: HTTP response-code for missing querystring?

2006-09-22 Thread James Bennett
On 9/22/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I would use 403 (forbidden) or 404. Note that, as per the RFC, 403 > responses indicate that authorization will not help and the request > should not be repeated unchanged. You can even put something like "quit > screwing around with the

Re: Problem with patch 2070

2006-09-22 Thread jp
I never could get #2070 to work, and Django's file upload mechanism is really iffy currently. What I ended up doing was this: --- I found out a solution to the problem! Today I thought about possibly subverting Django's way of parsing file uploads and using something else to do so, while still

What I lost if run django under Python 2.3?

2006-09-22 Thread mamcxyz
I'm configuring a new server with Centos 4 and have installed python 2.3... like you know is tricky upgrade python in Centos and the only safe workaround is run another python. I do this for other server but found very painfull manage two python versions and lost the automatic installing capabili

Re: Sample code for progress bar using patch 2070?

2006-09-22 Thread jacobm
[EMAIL PROTECTED] wrote: > I adapted UploadProgress.js to be used in the admin, so it latches on > to the first form in the page if the js is loaded. > > To use uploadprogress load: > > django.middleware.upload.UploadStateMiddleware and > django.middleware.upload.StreamingUploadMiddleware in this

Re: syncdb threw exception because libpq.so.4 could not be found

2006-09-22 Thread skuo
Malcolm, It is indeed a dynamic link failure. ldd /usr/lib/python2.3/site-packages/psycopgmodule.so libpq.so.4 => not found libcrypt.so.1 => /lib/libcrypt.so.1 (0x00212000) libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00ea3000) libdl.so.2 => /lib/libdl.so.2 (0x0

Re: two models -> one form -> addmanipulator

2006-09-22 Thread DavidA
Ulrich Nitsche wrote: > hi, > > i have two models (tables) concerning user data which belong together. > Now I would like to use one single form to display and edit these > values. > Is there a way to use one changemanipulator to do this? > Or if this is not possible is there a way to use differe

Re: HTTP response-code for missing querystring?

2006-09-22 Thread gabor
Corey Oordt wrote: > I'm not sure I can appreciate why you would require a URL to have a > query string. It seems to go against the anti-crufty URLs that Django > is trying to avoid. > > Query strings, if I understand them correctly are really meant to > provide a subset or context of an ot

Re: settings.py help please

2006-09-22 Thread NakedHTML
Setting up everthing on Mac OS X can be frustraiting! It took me more than a few days to get it right on Tiger. Starting from scratch, with OS X 10.4.x, I updated my xcode/xtools (to 2.4) to make sure the gcc was up to date. I installed apache 2.2.3 using darwin ports, and then installed the

Admin interface question

2006-09-22 Thread Tom Smith
If I have a class Catalog which relates to a class Product... in the admin interface I'd like to specify a function (to be used to navigate to related products) rather than a field... like this... class Catalog(models.Model): name = models.CharField(maxlength=200, core=True, db_index

FileField in the list_display option

2006-09-22 Thread Vizcayno
Hello: Into the admin I am including a FileField in the "list_display" option. Is there a way to indicate Django that when clicking this FileField, the content of the file is shown instead of the "change" page? Thanks!!! --~--~-~--~~~---~--~~ You received this mes

Re: Python 2.5 anyone

2006-09-22 Thread Vizcayno
I have problems to get mod-python for python 2.5 (win32). Does anybody knows how to get this version. Thanks!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: settings.py help please

2006-09-22 Thread Malcolm Tredinnick
On Fri, 2006-09-22 at 19:45 +, NakedHTML wrote: > Setting up everthing on Mac OS X can be frustraiting! > > It took me more than a few days to get it right on Tiger. > > Starting from scratch, with OS X 10.4.x, [...] > and then went on to the django install. It took a week of reinstalling >

Re: Re: settings.py help please

2006-09-22 Thread James Bennett
On 9/22/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > The other problem is finding people who have solved the problem and > taken notes and not made too many assumptions. If somebody is very > experienced using a Mac, their installation instructions are going to > miss things that other peop

Re: What I lost if run django under Python 2.3?

2006-09-22 Thread Joe
If I were you, I would just try to upgrade my python install. We are using Red Had ES 4 and it came with python 2.3.4 which had a few bugs in it, which forced us to upgrade to python 2.3.5. We found that RPMs don't really work that well, but compiling from source seemed to work just fine. Hope

Re: Getting the values from a Sparse Matrix in a template

2006-09-22 Thread Malcolm Tredinnick
On Sat, 2006-09-23 at 00:12 +1000, Woolley wrote: > Hi, > > I was wondering how to read a sparse martrix in a django template. I can > generate the matrix in the view function, but I cannot seem to get the > results to come out. > > Basic assignment/ format below, not how it is really done tho

Re: What I lost if run django under Python 2.3?

2006-09-22 Thread Malcolm Tredinnick
On Fri, 2006-09-22 at 08:49 -0700, mamcxyz wrote: > I'm configuring a new server with Centos 4 and have installed python > 2.3... like you know is tricky upgrade python in Centos and the only > safe workaround is run another python. > > I do this for other server but found very painfull manage tw

Re: What I lost if run django under Python 2.3?

2006-09-22 Thread Russell Keith-Magee
On 9/22/06, mamcxyz <[EMAIL PROTECTED]> wrote: > If I stick to python 2.3, apart from decorators, why I lost? The canonical list of Python 2.3->2.4 differences is at: http://www.python.org/doc/2.4.3/whatsnew/whatsnew24.html As far as Django is concerned: Django works with Python 2.3. We have a

Re: Getting the values from a Sparse Matrix in a template

2006-09-22 Thread Woolley
Malcolm, Many thanks, I will go with the first option, it is not a great change to enable this, and I would rather not cross the line on the template side. Rgds Trevor Malcolm Tredinnick wrote: >On Sat, 2006-09-23 at 00:12 +1000, Woolley wrote: > > >>Hi, >> >>I was wondering how to read a s

One-To-Many doesn't return a list.

2006-09-22 Thread Tyson Tate
I've got the following model: http://paste.e-scribe.com/1666/ And I'm trying to run the following in the Event object's object_detail generic view template: {% for slot in object.signupslot_set.all %} But it bombs with a "iteration over non-sequence" error every time. What gives? In the sh

How to test Validatidators

2006-09-22 Thread Maximillian Dornseif
I'm struggeling to build tests for (custom) validators - see http://www.djangoproject.com/documentation/forms/#validators for the basics. To my understanding there are two kinds of validators: a) Validators inherent to a Field type, e.g. isValidEmail for EmailField b) custom validators set via