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) an

Re: Switching between databases with same project/model

2007-10-14 Thread identify
On 14 Okt., 09:40, patrickk <[EMAIL PROTECTED]> wrote: > 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

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 > * > * websi

Re: How to add a onclick attribute to a newforms element

2007-10-14 Thread Matt
Greg, You might want to give http://en.wikipedia.org/wiki/Unobtrusive_JavaScript a read. It discourages the use of inline javascript like that. Matt. On Oct 14, 1:01 am, Greg <[EMAIL PROTECTED]> wrote: > Nevermind, > Got it figured out > > s_check = > forms.CharField(widget=forms.CheckboxInput(

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: 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 ju

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 def

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 l

Re: Howto read XML files

2007-10-14 Thread Russell Keith-Magee
On 10/13/07, tnoo <[EMAIL PROTECTED]> wrote: > > Hi > > Coming from Cocoon I have a bunch of XML files laying around. Is it > possible > to easily read those, instead of reading the data from a database? I > am aware > of elementtree to get the XML into a useful Python class, but how to > best > p

[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 = get_object_or_404(Pol

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 p

Re: deseb installation in ubuntu

2007-10-14 Thread Xan
Okay, Derek, it's fixed _effectively_ in 0.2.2. It works for me! Thank you VERY MUCH for your support, Xan. On Oct 13, 12:12 am, Derek Anderson <[EMAIL PROTECTED]> wrote: > xan, > > this is fixed in the latest version of deseb. (v0.2.2) > > feel free to pm me if you have any further problems, o

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,

do you use pydev for django development?

2007-10-14 Thread lmierzej
hi, I need advise... i've started using pydev for django development but it have some quirks... for example if i retrieve my model's objects by invoking get_object_or_404() function code completion doesn't work on object retrieved with this function... maybe it is just me or pydev shortcoming?...

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 formfield

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 * > fro

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 st

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 solu

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 /admin/player/playerprofile/5/

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 su

{% 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: 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 h

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 c

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 http://dpa

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

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: 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 Subversion

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 : /templates/

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

2007-10-14 Thread Andrew
Ah! Perfect! Good ol' .96! On Oct 14, 1:00 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-10-14 at 19:38 +, Andrew wrote: > > According tohttp://www.djangoproject.com/documentation/templates/#spaceless, > > {% spaceless %} should remove _all_ whitespace between tags, not > >

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).

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 and

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 complet

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 t

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 form

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 i

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 a

Re: Should I create a session variable for this?

2007-10-14 Thread Greg
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 sales tax has not been shown, and a 1 for when the sales tax message has

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 sale

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/ --~--~-~--~~~---

Davis another e-commerce Django application

2007-10-14 Thread Djoume
Hi all, Today I published Davis : an open source e-commerce application. It's my first "big" Django app so I would love to hear feedback from you. With Davis you can very easily create and manage your own online store from your web browser : * Create your products, with as many pictures, s

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 Co

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

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: 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 --~--~-~-

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 thro

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)

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 ge

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 = models.ForeignKey(Child,verbose_name=_("Child")

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 = models.ForeignKey(Sponsor,verbose_name=_("Sponsor"

Re: bug in rendering non ascii characters in admin changelist

2007-10-14 Thread Kenneth Gonsalves
On 15-Oct-07, at 10:57 AM, Malcolm Tredinnick wrote: > So, in the rare case where, say, self.sponsor is a UTF-8 string, > Kenneth's version might lead to trouble down the track -- but I would > have thought that trouble would be mis-displayed strings, rather > than a > crash. ok - when I put