Re: Pass extra data to a view

2008-05-03 Thread Mike Chambers
Could you just specify the data in the URL that you redirect to? mike Jay Parlar wrote: > On 5/2/08, Jay Parlar <[EMAIL PROTECTED]> wrote: >> I must be missing something super obvious here, but I can't figure out >> how to pass data to a new view, from the old one. >> >> For example, I have th

Re: get_FOO_display() and Update Messages

2008-05-03 Thread dimrub
Yay another fitness app based on django! http://code.google.com/p/fiteat/ On May 3, 9:15 am, Greg Taylor <[EMAIL PROTECTED]> wrote: > I was wondering if there's any reason why get_FOO_display() calls > aren't being evaluated when updating/adding new objects via the admin > interface. What I mean

Default Pluralize logic

2008-05-03 Thread [EMAIL PROTECTED]
Could someone please be kind to explain to me how the pluralize logic works in django? a.) pluralize template filter b.) Meta.verbose_name_plural As default, I am expecting the pluralize to convert "country" to "countries". For exapmle, this doesn't happen in admin so I define the verbose_name_pl

Re: Pass extra data to a view

2008-05-03 Thread Lei Zhang
Hi I used to do this by putting the data in URL parameters. Does anyone knows a more elegant way to do this? > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

When and how is dispatcher.connect() called?

2008-05-03 Thread Jonathan Lukens
I have two functions in a signals.py module that I would like called whenever instances of a number of models are saved or deleted. Everything works as intended when I add all of this to each models.py module: from django.dispatch import dispatcher from django.db.models import signals from projec

djangoAMF: django and flash

2008-05-03 Thread Lorenzo
Hi, I need to link a flash movie with Django, so I userd djangoAMF. I followed the tutorial (http://djangoamf.sourceforge.jp/index.php?UserManual_en) and seems to work fine, but when I put the results inside a textbox in my flash application, it understand data as a float number! In django I

absolute url overrides

2008-05-03 Thread Thierry
ABSOLUTE_URL_OVERRIDES = { 'django.contrib.auth.models.user': lambda o: "/members/%s/" % o.username, } Doesn't seem to be working, any idea why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Templating patterns

2008-05-03 Thread pk
sometimes extending the template system with application specific tags solves my problem. YMMV of course. On May 2, 1:49 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've got a lot of templates with the same pattern, so i want to put > some code like this in a template. > > {% if iterable

Re: Patch #2070, progress bar and form view. Can't make it work.

2008-05-03 Thread John Hensley
The handling of the POST request is typical. I don't know what your model class looks like, but the could look something like this: form = UploadForm(request.POST, request.FILES) if form.is_valid(): instance = ModelClassWithFileField() instance.uploaded_by = request.user

Re: Should I set up Django locally or on a web server?

2008-05-03 Thread pk
if you are running Leopard (IMPORTANT) it is very easy to setup Django. I wrote up what I did here: http://www.pkshiu.com/loft/archive/2008/01/django-on-leopard The key is to just use sqlite and the development server to do development. There are some issues with sqlite compare to postgresql (I

Django on mod_python... Admin interface, no styling...

2008-05-03 Thread Abdallah El Guindy
Hey all I tried deploying my django project on apache+modpython as the tutorial described... Everything works fine except that the admin website displays unformatted ... (could not manage to find the stylesheet somehow), can anyone tell me what went wrong? Thanks --~--~-~--~~

Re: Template variable in filter?

2008-05-03 Thread pk
Isn't this already in settings.py? Look at the code for the filters /django/template/defaultfilters.py it reads DATE_FORMAT and TIME_FORMAT from the settings file. P.K. On Apr 29, 2:25 am, Mike Chambers <[EMAIL PROTECTED]> wrote: > Is it possible to include a template variable inside a filter? >

Translated DB

2008-05-03 Thread dimrub
Suppose, you want to have a model, the fields of which are available in multiple languages. How would you people go around doing it? The most trivial method would be to define as many variations of each text field as there are lanugages, and define a function inside the model that returns the vari

Re: Translated DB

2008-05-03 Thread Panos Laganakos
Two projects exist: http://code.google.com/p/django-multilingual/ http://code.google.com/p/transdb/ DM uses an inner class on the model, to define the translatable fields. TransDB uses custom field types. Hopefully they'll be merged at some point or work on a new uniform way to do this. On M

Re: Translated DB

2008-05-03 Thread Dmitry Rubinstein
Wow, thanks! Now I have to decide which one to use... :) On Sat, May 3, 2008 at 4:26 PM, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > Two projects exist: > > http://code.google.com/p/django-multilingual/ > http://code.google.com/p/transdb/ > > DM uses an inner class on the model, to define the

Re: Sorry to butt in. I'm just trying to get my message out.

2008-05-03 Thread Etienne Robillard
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 2 May 2008 11:49:19 -0700 (PDT) Slayer <[EMAIL PROTECTED]> wrote: > > Please come check out SaveTheWorld. It's my own group that I'm trying > to get started. > There's no harm in looking is there? Come see what I'm trying to do > to change

Re: Django on mod_python... Admin interface, no styling...

2008-05-03 Thread jonknee
> I tried deploying my django project on apache+modpython as the > tutorial described... Everything works fine except that the admin > website displays unformatted ... (could not manage to find the > stylesheet somehow), can anyone tell me what went wrong? See "Serving the admin files" in the mod

How can I pass extra context variables into my changelist_view?

2008-05-03 Thread Brot
Hello, today I switched my django installation from the django-trunk to the django newforms-admin branch. With the oldform admin I had changed the changelist for one model based on the explanation in the djangobook (http://www.djangobook.com/ en/1.0/chapter17/) But with the newforms admin I coul

Re: Django on mod_python... Admin interface, no styling...

2008-05-03 Thread Abdallah El Guindy
Thanks... that solved it! On May 3, 6:22 pm, jonknee <[EMAIL PROTECTED]> wrote: > > I tried deploying my django project on apache+modpython as the > > tutorial described... Everything works fine except that the admin > > website displays unformatted ... (could not manage to find the > > styleshee

Re: Pass extra data to a view

2008-05-03 Thread Jay Parlar
On 5/3/08, Mike Chambers <[EMAIL PROTECTED]> wrote: > > Could you just specify the data in the URL that you redirect to? > > mike In my case, it's a variable amount of data, a list of ids from the database. I suppose I could specify it in the URL. I've got it working with sessions now, but pass

Production vs Development Environments

2008-05-03 Thread titaniumlou
A post from another thread got me wondering, how many people here have their development environments closely mimic their production ones? Or is it common to have a development, staging and production environments ? That way your development environment could be whatever is easiest for you to se

Re: Production vs Development Environments

2008-05-03 Thread Ben Ford
We have several different mercurial repos backing instances of our project, and this works well. We can have different developers pushing their changes to different instances of th site for testing and then all of their changes can be consilidated into 'trunk' ready to be pushed to our live servers

Re: Installation problem...

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 12:09 AM, Pedro Vidal <[EMAIL PROTECTED]> wrote: > Hello guys, I'm a new django user, and I'm tryin since three days ago > install django, but it's still not working... > That's the problem: > > Installed Python, ok. > Installed mod_python, ok. > Downloaded and extracted dja

Re: get_FOO_display() and Update Messages

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 2:15 AM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > I was wondering if there's any reason why get_FOO_display() calls > aren't being evaluated when updating/adding new objects via the admin > interface. What I mean by this is: > > The workout "1" was changed successfully. >

Re: Default Pluralize logic

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 5:39 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Could someone please be kind to explain to me how the pluralize logic > works in django? > a.) pluralize template filter Doc for this is here: http://www.djangoproject.com/documentation/templates/#pluralize > b.) Me

Re: absolute url overrides

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 8:28 AM, Thierry <[EMAIL PROTECTED]> wrote: > > ABSOLUTE_URL_OVERRIDES = { >'django.contrib.auth.models.user': lambda o: "/members/%s/" % > o.username, > } > > Doesn't seem to be working, any idea why? > Doc ( http://www.djangoproject.com/documentation/settings/#absolut

[newforms-admin] using multiple AdminSites

2008-05-03 Thread derek.hoy
I've just move a project onto newforms-admin, and the change has gone fine. Thanks to all who've worked on this. The project has a public site and some customised admin for office staff, so I'm thinking about having 2 AdminSites, one for office staff and a basic one for sysadmin. The /docs/admi

Pass variable with HttpResponseRedirect

2008-05-03 Thread Poz
Hello fellow Django users, I've got what I hope to be a simple question. I've got a page with 4 forms on it. Each goes to a different URL then uses HttpResponseRedirect to get back to the original page. I want to pass back any errors to the main screen. How can I pass a variable with HttpRespons

Re: Admin : Select category -> show subcategory

2008-05-03 Thread Diego Ucha
Hello Martyn, The main interaction, that i see you need is: (On Product form) User select Category -> Subcategory field is auto- filled -> User select a subcategory based on the category selected. Then you will have to use some JS Library (I prefer JQuery, besides there are some discussion about

FreeSHOUTcast.com - Creating and offering the best SHOUTcast Servers

2008-05-03 Thread FreeSHOUTcast.com
Check! http://www.FreeSHOUTcast.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email t

Re: Production vs Development Environments

2008-05-03 Thread Justin Lilly
Hey Ben, You may consider virtualizing it. VMWare's offerings are getting nicer and nicer and if you have a decent system around, Xen is also something to check out. -justin On Sat, May 3, 2008 at 2:45 PM, Ben Ford <[EMAIL PROTECTED]> wrote: > We have several different mercurial repos backing in

Re: Pass variable with HttpResponseRedirect

2008-05-03 Thread Peter Rowell
> How can I pass a variable with HttpResponseRedirect? I've tried: I suggest using the session. This allows you to have arbitraily complex error structures. E.g., session['errors'] = HttpResponseRedirect('to somewhere') then in your other view(s) do something like:

Re: Pass variable with HttpResponseRedirect

2008-05-03 Thread Michael
It would be very restful of you to pass that information through the url. Beyond that you should look into sessions as described above or another function (i don't know what that is), HttpResponseRedirect just redirects the user's browser to another url. Hope that helps, Michael On Sat, May 3, 2

Can I use Django to display data form a legacy database?

2008-05-03 Thread jmDesktop
If all I want to do is display a row(s) from a legacy database, one that I did not create with Django and syncdb, will Django do that? Do I have to alter my legacy database in any way (assume it's a pre- existing MySQL, Oracle, or SQL Server database)? Thank you. --~--~-~--~~

Re: Can I use Django to display data form a legacy database?

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 11:55 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > > If all I want to do is display a row(s) from a legacy database, one > that I did not create with Django and syncdb, will Django do that? Do > I have to alter my legacy database in any way (assume it's a pre- > existing MySQ

child edit causes duplication with model inheritance

2008-05-03 Thread [EMAIL PROTECTED]
try: class Base(models.Model): name = CharField(max_length = 100) class Admin: pass class A(Base): desc = TextField() class Admin: pass if you add an "A" object then edit it and hit save it duplicates itself. Does anyone else have this trouble with model inheritan

Re: Using django test suite with standalone script

2008-05-03 Thread Russell Keith-Magee
On Thu, May 1, 2008 at 9:02 PM, dcoy <[EMAIL PROTECTED]> wrote: > > What I want to do is to use the django test suite, or more > specifically the test environment it can set up (with the test-db with > pre-populated data) to test the client-server part of the system. Have you looked into the '