Re: selected ModelMultipleChoiceField

2008-12-08 Thread Håkan Waara
dec 2008 kl. 18.30 skrev Abdel Bolanos Martinez: > what I want is use ModelMultipleChoiceField with a queryset but I > need that some of the of the generated be mareked > as , > > Bite? > > > On Mon, 2008-12-08 at 17:36 +0100, Håkan Waara wrote: >> >> If

Re: selected ModelMultipleChoiceField

2008-12-08 Thread Håkan Waara
If you want to set it to always the same values, you can use the "initial" argument on your form field. Pseudo-example (haven't run the code, but it illustrates the solution): class MyForm(forms.Form): end = forms.DateField(label="Until", required=False, initial="2009-11-12") If you n

Re: including javascript in templates

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 17.35 skrev David Sáez: > > Hi, I'm a newbie to django and I'm dealing with some configuration > stuff that is making me going crazy. My problem is very simple and I > have a temporal solution, but I guess there might be a better way to > do it. So... there goes the question... > >

Re: don't escape html tags

2008-11-06 Thread Håkan Waara
The documentation for the template system will give you the answer: http://docs.djangoproject.com/en/dev/topics/templates/ /Håkan 6 nov 2008 kl. 17.16 skrev gontran: > > hello, > > I just started to learn django, so my question may be stupid: > > In my template, I would like to display a html

Re: Model ForeignKeys to other Models

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 10.05 skrev Daniel Roseman: > The problem is not with the imports (you were fine with the original > method - in fact I'd recommend it, to avoid any future problems with > circular imports), but with the __unicode__ methods. As the error > states, you're referring to the related ob

Re: Model ForeignKeys to other Models

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 08.42 skrev joshuajenkins: > > I'm sure I'm doing this wrong but can't really find an answer in the > docs or by searching. > > I have two models (relative to this problem). One is called events, > one is called projects > > a portion of models.py for projects looks like this: > >

Re: help regarding generic views

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 06.12 skrev Low Kian Seong: > > Dear all, > > Here is the excerpt of my urls.py > > (r'^stocks_edit/(?P\d+)/?$', create_update.update_object, > dict(stock_information, >post_save_redirect="/")), > I don't know about your specific problem, but I can see at least one

Re: Some questions to the Django auth system

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 05.40 skrev erdmaennchen: > > I'm doing some testruns on Django to find out how it fits me. Until > now: Just great. But - as always - there are some problems you > encounter when you are inexperienced with a specific framework. I've > some Problems at the moment with the built-in

Re: Overriding update in models

2008-11-04 Thread Håkan Waara
Instead of manually setting the update time and created date, as it seems like you mean to do here, I highly recommend auto_now and now auto_now_add attributes that you can add to your date fields, to get this functionality for free. See http://docs.djangoproject.com/en/dev/ref/models/fiel

"Mix and match" model form?

2008-11-04 Thread Håkan Waara
Hello all, A situation that I'm encountering all the more often is something like this: You create a form that has some fields that belong to one model, and some fields from another model. Because it's a mix, you can't make it as easy as a ModelForm. I love ModelForms. :-) One common examp

Re: Is there a way to host serveral django projects under a single virtual host

2008-10-31 Thread Håkan Waara
31 okt 2008 kl. 16.43 skrev ilyail3: > > hello people, Is there a way to host several django projects under a > single virtual host? > I know this is possible with mod_php with wildcards as server alias > > and later map urls to dirs using mod_rewrite > > >DocumentRoot /var/www >ServerNa

Re: How to setup django-apache-mod_wsgi without killing existing php site?

2008-10-31 Thread Håkan Waara
31 okt 2008 kl. 04.23 skrev Graham Dumpleton: > > > > On Oct 31, 10:14 am, Håkan Waara <[EMAIL PROTECTED]> wrote: >> Hi folks, >> >> I'm in the process of for the first time deploying a django site that >> (unfortunately) needs to share its Ap

How to setup django-apache-mod_wsgi without killing existing php site?

2008-10-30 Thread Håkan Waara
Hi folks, I'm in the process of for the first time deploying a django site that (unfortunately) needs to share its Apache with an existing PHP site. I've been reading a bunch about mod_wsgi and in many places there are mentions that setting up apache with mpm-worker (basically multithreade

Re: Handling multiple sites branched off of one main site

2008-10-30 Thread Håkan Waara
30 okt 2008 kl. 19.23 skrev Wayne M: > exactly this and it makes fixing anything insanely difficult. > > Any suggestions to point me in the right direction would be > appreciated... like I said I'm not sure if Django fits my needs in > this case. I think Django sounds ideal in your situation.

Re: Error Pages and Flatpages

2008-10-16 Thread Håkan Waara
Try searching for 404 on http://docs.djangoproject.com -- there's both flatpages-specific information on how to deal with 404 errors and also how to handle it in general in your django apps. In general, try searching the django docs site first -- there's a lot of good info there. /Håkan

Re: form fields

2008-10-10 Thread Håkan Waara
Or, as Adrian suggests, you can put verbose_name on the field on your *model*, not in the modelform. /H 10 okt 2008 kl. 10.37 skrev Ulises: > >> class GameForm(ModelForm): >> class Meta: >> model = Game >> time_days_W = forms.CharField(max_length=128, >> verbose_name="time") >

Re: get_template problem

2008-09-26 Thread Håkan Waara
from django.template.loader import get_template I recommend learning some general python before you dive into django. There are lots of great sites for this, for example www.diveintopython.org /H 26 sep 2008 kl. 15.44 skrev NoviceSortOf: > > > this works > from django.template import lo