Re: bug in rendering non ascii characters in admin changelist

2007-10-14 Thread Malcolm Tredinnick
On Mon, 2007-10-15 at 00:10 -0500, Jeremy Dunck wrote: > On 10/14/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > ... > > class Sponsorship(models.Model): > > """ links child to sponsor, startdate enddate and comments""" > > sponsor =

Re: bug in rendering non ascii characters in admin changelist

2007-10-14 Thread Jeremy Dunck
On 10/14/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: ... > class Sponsorship(models.Model): > """ links child to sponsor, startdate enddate and comments""" > sponsor = models.ForeignKey(Sponsor,verbose_name=_("Sponsor")) > child =

Re: bug in rendering non ascii characters in admin changelist

2007-10-14 Thread Kenneth Gonsalves
On 08-Oct-07, at 7:36 AM, Malcolm Tredinnick wrote: >> name = CharField of some some length and have >> __unicode__() = "%s" %(self.name) >> >> in admin enter a finnish word with special characters like: Asikainen >> Päivi ja Jorma. On saving, or after saving, on trying to edit the >> word I

Re: Should I create a session variable for this?

2007-10-14 Thread Greg
Malcolm, I got it working. Here it is: if request['b_state'] == 'KS': if request['seen_updates'] == '0': a = theamount(request, 1.06) data = request.POST.copy() data['seen_updates'] = 1 f = ContactForm(data)

How to find out if a string is contained within another string

2007-10-14 Thread Greg
Hello, I'm wanting to select a record from my Discounter class that contains a certain string from another string. My Discounter class looks like this: class Discounter(models.Model): code = models.CharField(maxlength=100) In my view I get a variable called 'message'. I want to search

Re: NoReverseMatch error

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 19:45 -0700, ashok.raavi wrote: > Any body got this NoReverseMatch problem fixed?. If so please point me > to that. Which problem would that be? You have provided no context at all for your question. We are helpful people, but not mind readers. Malcolm

NoReverseMatch error

2007-10-14 Thread ashok.raavi
Any body got this NoReverseMatch problem fixed?. If so please point me to that. The patch over here http://code.djangoproject.com/attachment/ticket/4409/4409.patch is also not working for me . I am using the latest trunk from django repository.

Re: Should I create a session variable for this?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 18:32 -0700, Greg wrote: > Malcolm, > I think I'm finally starting to get somewhere with this. I assigned > my hidden field the initial 0 value > > seen_updates = forms.IntegerField(widget=forms.HiddenInput, initial=0) > > I was thinking that I could just do the following

Re: Should I create a session variable for this?

2007-10-14 Thread Greg
Malcolm, I think I'm finally starting to get somewhere with this. I assigned my hidden field the initial 0 value seen_updates = forms.IntegerField(widget=forms.HiddenInput, initial=0) I was thinking that I could just do the following 'request['seen_updates'] = '1'' in my view and just resend

Re: Urgent requirement for architect job

2007-10-14 Thread Kenneth Gonsalves
On 14-Oct-07, at 3:43 PM, Dan Filip wrote: > WHY DOESN'T ANYONE BLOCK THESE STUPID ADS??? dont *do* this - you are just increasing the spam. Trust the list admins. -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/

Re: Should I create a session variable for this?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 17:35 -0700, Greg wrote: > Malcolm, > I've created a new form field: > > seen_updates = forms.IntegerField(widget=forms.HiddenInput) > > I've added the form field to my checkout page: > > > {{ fo.seen_updates }} > > How do I assign it a value of 0 for when the

Re: Object not callable

2007-10-14 Thread Cat
Hi Malcolm Thanks for your reply. I have done a bit of reading/experimentation since my post and thought what you have said might be the case. I will have a look at your suggestions. However, I think I may be on the wrong track. What I want to do is create a custom form (ie SurveyForm) to both

Re: Should I create a session variable for this?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 16:24 -0700, Greg wrote: > Malcolm, > Can you please show me how I would use hidden fields to let me know > that the user has seen the updated price? There's a newforms widget called HiddenInput. So if your form has a field called, say, "seen_updates", make sure you create

Re: Should I create a session variable for this?

2007-10-14 Thread Greg
Malcolm, Can you please show me how I would use hidden fields to let me know that the user has seen the updated price? Thanks On Oct 14, 5:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-10-14 at 15:18 -0700, Greg wrote: > > Hello, > > I have a submission form. When the

Re: Should I create a session variable for this?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 15:18 -0700, Greg wrote: > Hello, > I have a submission form. When the form gets submitted I need to > check to see if the b_state form variable is set to 'KS'. If so, then > I need to let the user know that a sales tax will be applied to their > order. If they agree with

Re: pydev code completion problem

2007-10-14 Thread lmierzej
I guess it all is just not possible in dynamically typed language... On Oct 14, 3:07 pm, lmierzej <[EMAIL PROTECTED]> wrote: > hi, > in models.py I have Poll class... > > when in views.py I do: > poll = Poll() > then when typing 'poll.' (just after typing '.') I get full and proper > code

Should I create a session variable for this?

2007-10-14 Thread Greg
Hello, I have a submission form. When the form gets submitted I need to check to see if the b_state form variable is set to 'KS'. If so, then I need to let the user know that a sales tax will be applied to their order. If they agree with the price increase then they can select 'Submit' again

Re: {% spaceless %} doesn't work?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 20:54 +, Andrew wrote: > Ah! Perfect! Good ol' .96! It's actually a bug that we didn't put a note in the current docs that the current behaviour is "new in development version". I'll try to remember to fix that later today (working on something else right now, though).

Re: Cab issue

2007-10-14 Thread Nicolas Steinmetz
[EMAIL PROTECTED] a écrit : > Exception Value: Template u'base.html' cannot be extended, because it > doesn't exist It's a "convention" in django that your main template is named "base.html". It should be place in the root directory of your template directory. Let's imagine :

Re: Cab issue

2007-10-14 Thread Jeremy Dunck
On 10/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This obviously means that i have misunderstood somthing in the > Templates section of the readme. Could someone provide some example > templates or requirements and locations for the templates needed? > >From the ReadMe: "The

Cab issue

2007-10-14 Thread [EMAIL PROTECTED]
I have problems getting the Cab (http://code.google.com/p/cab/) application up and running. I have followed the instructions in the readme, but it fails with: Request Method: GET Request URL:http://localhost:8000/snippets/ Exception Type: TemplateSyntaxError Exception Value:

Re: do you use pydev for django development?

2007-10-14 Thread lmierzej
Thank you very much for your replay! I understand it now... until get_object_or_404() is invoked how can anyone know what would it return... am I thinking correct? On Oct 14, 9:46 pm, Andrew <[EMAIL PROTECTED]> wrote: > So much of models are generated on the fly, I usually count it as luck > if

Re: {% spaceless %} doesn't work?

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 19:38 +, Andrew wrote: > According to http://www.djangoproject.com/documentation/templates/#spaceless, > {% spaceless %} should remove _all_ whitespace between tags, not > insert a single space between them... > > So why does http://dpaste.com/22430/ turn into

Re: {% spaceless %} doesn't work?

2007-10-14 Thread James Bennett
On 10/14/07, Andrew <[EMAIL PROTECTED]> wrote: > So why does http://dpaste.com/22430/ turn into http://dpaste.com/22431/ > ? Quoth the documentation: "Only space between tags is removed — not space between tags and text." -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: do you use pydev for django development?

2007-10-14 Thread Andrew
So much of models are generated on the fly, I usually count it as luck if I get any code completion at all. I don't think any other IDE will help you here. On Oct 14, 8:03 am, lmierzej <[EMAIL PROTECTED]> wrote: > hi, > I need advise... > i've started using pydev for django development > but it

{% spaceless %} doesn't work?

2007-10-14 Thread Andrew
According to http://www.djangoproject.com/documentation/templates/#spaceless, {% spaceless %} should remove _all_ whitespace between tags, not insert a single space between them... So why does http://dpaste.com/22430/ turn into http://dpaste.com/22431/ ?

Re: Object not callable

2007-10-14 Thread Malcolm Tredinnick
On Thu, 2007-10-11 at 17:34 -0700, Cat wrote: > Hello > > Can anyone tell me why when I get to the line - form = > InstanceForm(request.POST) in the following view (stepping through the > code), I get a Type Error SurveyForm object is not callable. My > understanding is that it should be as it

Re: UnicodeError in admin in latest django

2007-10-14 Thread Malcolm Tredinnick
On Fri, 2007-10-12 at 10:10 +0200, Michal Konvalinka wrote: > Hi group, > I have a problem with this variable in > django.contrib.admin.templates.admin.change_form.html > {{ original|truncatewords:"18"|escape }} > > I'm getting this error: > > UnicodeEncodeError at

Re: UnicodeError in admin in latest django

2007-10-14 Thread Malcolm Tredinnick
On Fri, 2007-10-12 at 10:29 +0200, Dirk Eschler wrote: [...] > i got around most of my unicode related problems by setting Pythons default > encoding to utf-8. > > $ cat /usr/lib/python2.4/sitecustomize.py > import sys > sys.setdefaultencoding("utf-8") Oh, no. That's a highly unrecommended

Re: why HTML output in unicode?

2007-10-14 Thread Malcolm Tredinnick
On Fri, 2007-10-12 at 22:24 +0400, Ivan Sagalaev wrote: > Ken wrote: > > Sorry if this is a stupid question, but why do forms output HTML as > > unicode strings? Is this arbitrary or is there some grand convention > > we are all supposed to be following? > > The general convention is that all

Re: setup_environ(settings) fails

2007-10-14 Thread Malcolm Tredinnick
On Sun, 2007-10-14 at 11:52 +, faypy wrote: > it's a simple test script: > > from django.core.management import setup_environ > import settings > settings.DATABASE_NAME = '/home/me/mysite/libtest.sdb' > print settings.DATABASE_NAME > setup_environ(settings) > > from ist.models import * >

Example for update_object

2007-10-14 Thread Florian Lindner
Hello, I'm looking for an example on how to use the django.views.generic.create_update.update_object generic view. Some of the concrete question I have: Is object.get_absolute_url() a function I need to implement in my model? The documentation of the view links to the manipulator and

OT: How did you handle asynchronous tasks?

2007-10-14 Thread David Larlet
Hi all, A bit off-topic but I wonder how did you handle asynchronous tasks like emailing or crawling or put-here-your-secret-asynchronous-service in your django projects? There are some solutions like django-mailer but what about a more general (twisted?) queuing service? Any thoughts? Regards,

Re: Help with Jinja Template

2007-10-14 Thread Brutus
Sorry for the push but can anyone drop me some hints or links? I do: print tmpl.render({"playlist": playlist}) Well playlist is a dictionary containing the tag-value pairs, parsed from the corresponding YAML file. In the template i want to itterate over a list of allowed tags and if the tag is

[django 0.96] pydev code completion problem

2007-10-14 Thread lmierzej
hi, in models.py I have Poll class... when in views.py I do: poll = Poll() then when typing 'poll.' (just after typing '.') I get full and proper code completion and that's just great... but when I have something like this in views.py: def poll(request, poll_id): poll =

Re: Adding permissions in a fixture

2007-10-14 Thread Russell Keith-Magee
On 10/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Aug 14, 7:06 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> > wrote: > It's been a while since we had this discussion, but I would like to > revisit it, if that's okay. > > We now have the testserver command that loads a fixture and

setup_environ(settings) fails

2007-10-14 Thread faypy
it's a simple test script: from django.core.management import setup_environ import settings settings.DATABASE_NAME = '/home/me/mysite/libtest.sdb' print settings.DATABASE_NAME setup_environ(settings) from ist.models import * from ist.tests import users the problem is it will change the

Re: TextField

2007-10-14 Thread Timothy Wu
On 10/14/07, Timothy Wu <[EMAIL PROTECTED]> wrote: > > Hi, > > I am using Django version 0.96. For some reason I cannot use TextField, > it's giving me this error while I am validating: > > NameError: name 'TextField' is not defined > > Other fields which I have, CharField and IntegerField works

TextField

2007-10-14 Thread Timothy Wu
Hi, I am using Django version 0.96. For some reason I cannot use TextField, it's giving me this error while I am validating: NameError: name 'TextField' is not defined Other fields which I have, CharField and IntegerField works just fine. What can I do? Timothy

Re: Urgent requirement for architect job

2007-10-14 Thread Dan Filip
WHY DOESN'T ANYONE BLOCK THESE STUPID ADS??? IS ANYBODY APPLYING FOR THIS? On 10/14/07, kamini thakur <[EMAIL PROTECTED]> wrote: > > Urgent requirement for architect job > > ALL INDIA JOBBANK > > *Pls sends your CV in **www.allindiajobbank.com > * > *

Re: Switching between databases with same project/model

2007-10-14 Thread patrickk
I´m having a similar problem and I´m not sure if different settings- files are the solution. our project has one database. within our site, we have a lot of games, where people can participate. the game-table has a lot of entries, so I ´d like to store old games in a second database (=archive)