Re: Shared views

2010-03-14 Thread Dan Carroll
You could use a base template that generates the life and right columns. For the other content on the page, you could create a block placeholder. Then, all of the other pages would extend that base template and replace the content block. You can read up on template inheritance here: http://docs.

how to make radio buttion selected as form is loaded

2010-03-14 Thread django_jedi
Hi All, Pardon a newbie. I'm building a form that will display workshop selections a person has made. They'll be able to update their selections using this form. Selections are represented by radio buttons; I'm trying to make a radio button the "checked" option as I run through a loop, and noth

passing more information with formsets

2010-03-14 Thread Alastair Campbell
Hi, I have a formset that is working well, but I'd like to use other information within that loop: {% for form in formset.forms %} [Member name would go here] {{ form }} {% endfor %} There is a queryset of member objects from the same view that matches the forms in the formse

Re: a bug (i think) with dynamic inlines and ManyToMany relationships

2010-03-14 Thread Russell Keith-Magee
On Sat, Mar 13, 2010 at 8:33 PM, Simon wrote: > Hi all, > > I've found what I think is a bug in django 1.2 beta 1 (SVN-12773). > > The dynamic inlines works great with foreign key relationships, but > the "Add another xxx" link doesn't appear with ManyToMany > relationships.  It seems to be becaus

Re: limit_choices_to a value on a field in the same model

2010-03-14 Thread Brandon Taylor
Walt, you're a lifesaver! Many thanks for the great example. I only made a couple of minor tweeks: class AgencyForm(forms.ModelForm): class Meta: model = Agency def __init__(self, *args, **kwargs): super(AgencyForm, self).__init__(*args, **kwargs) if self.instance

Re: is there any possibility for two settings.py

2010-03-14 Thread Robert Mela
We load custom environments at startup based on directory from which the app is loaded. The selection could just as easily be based on environment variable, machine name rather than directory path. The simple trick is to have settings.py serve as a proxy for those other, environment-specific

Re: run single regression test from test suite

2010-03-14 Thread Karen Tracey
On Sun, Mar 14, 2010 at 12:14 PM, ben wrote: > I haven't been able to work out how to run a single regression test > from the test suite. > > I would have thought that > > ./runtests.py --settings=test_sqlite > regressiontests.generic_relations_regress.tests.GenericRelationTests > > might work.

run single regression test from test suite

2010-03-14 Thread ben
I haven't been able to work out how to run a single regression test from the test suite. I would have thought that ./runtests.py --settings=test_sqlite regressiontests.generic_relations_regress.tests.GenericRelationTests might work. But it expects tests of the form app.TestCase. Since these te

Re: create_update generic view post_save_redirect problem.

2010-03-14 Thread sarg
Thanks a lot. It is a fourth enhancement that i am awaiting from 1.2 release. On Mar 14, 5:18 pm, Karen Tracey wrote: > On Sun, Mar 14, 2010 at 8:46 AM, sarg wrote: > > If post_save_redirect set to reverse('some_view') and reversed url > > contains tilde (~), then > > > return HttpResponseRedire

Re: send_mail UnicodeDecodeError: 'ascii' codec can't decode byte

2010-03-14 Thread ge...@aquarianhouse.com
it should work with: body = unicode("Treść", 'utf-8') On Mar 14, 3:49 pm, Michał Klich wrote: > Hi, > I do not fully understand how this works. > > I have > subject = "Temat" > body = "Treść" > from = some.em...@dot.com > to = some.em...@dot.com > > send_email(subject, body, from, to) prints out

send_mail UnicodeDecodeError: 'ascii' codec can't decode byte

2010-03-14 Thread Michał Klich
Hi, I do not fully understand how this works. I have subject = "Temat" body = "Treść" from = some.em...@dot.com to = some.em...@dot.com send_email(subject, body, from, to) prints out Traceback (most recent call last): File "/usr/lib64/python2.6/logging/__init__.py", line 773, in emit strea

Re: create_update generic view post_save_redirect problem.

2010-03-14 Thread Karen Tracey
On Sun, Mar 14, 2010 at 8:46 AM, sarg wrote: > If post_save_redirect set to reverse('some_view') and reversed url > contains tilde (~), then > > return HttpResponseRedirect(post_save_redirect % obj.__dict__) breaks > as post_save_redirect contains %7E. > Sounds like #12445: http://code.djangopro

Re: How do I rename a FileField() that's attached to a model?

2010-03-14 Thread Karen Tracey
On Sun, Mar 14, 2010 at 2:19 AM, Jumpfroggy wrote: > Who do I talk to about possibly contributing to the docs? > Contributing to the docs is handled just like contributing to the code. They are all in SVN, under a docs directory in the trunk. See http://docs.djangoproject.com/en/dev/internals/c

Shared views

2010-03-14 Thread grimmus
Hi, I have a site with a blog area and 5 pages powered by a simple cms. On every page i show event information in the right column and social media info in the left column. I am wondering what view should contain the info for the left and right column ? I would like to keep it separate from the

create_update generic view post_save_redirect problem.

2010-03-14 Thread sarg
If post_save_redirect set to reverse('some_view') and reversed url contains tilde (~), then return HttpResponseRedirect(post_save_redirect % obj.__dict__) breaks as post_save_redirect contains %7E. -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: limit_choices_to a value on a field in the same model

2010-03-14 Thread Walt
Here is an idea of what your forms.py should contain: class AgencyForm(ModelForm): class Meta: model = Agency def __init__(self, *args, **kwargs): super(AgencyForm, self).__init__(*args, **kwargs) if self.instance.id: if self.instance.state_id:

Re: django and buildout

2010-03-14 Thread andreas schmid
it seems to work with mr.developer [buildout] extensions = mr.developer sources = sources auto-checkout = django-mptt parts = django eggs = mock django-notification django-page-cms django-haystack [sources] django-mptt = sv

RE: Re: site management - maintanance mode

2010-03-14 Thread Henrik Genssen
Thanx all, it seems still to be the best, doing it in the load-balancer or web-server it self. Just was curious, if there is a python/django way... Thanks again -- Hinnack >reply to message: >date: 14.03.2010 08:12:13 >from: "Jukka Välimaa" >to: django-users@googlegroups.com >subject: Re: sit