Re: Switching between databases with same project/model

2007-10-13 Thread Russell Keith-Magee
On 10/13/07, Brian DeGeeter <[EMAIL PROTECTED]> wrote: > > So looks like there is no easy answer to my dynamic db settings. I'd > be interested in the complex answer if anyone has one. Specifically > for the command line tool we have. Editing the settings.py with a sed > script seems so crude.

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

2007-10-13 Thread Greg
Nevermind, Got it figured out s_check = forms.CharField(widget=forms.CheckboxInput(attrs={'onclick':'showship()'})) On Oct 13, 6:26 pm, Greg <[EMAIL PROTECTED]> wrote: > I have the following form field: > > s_check = forms.CharField(widget=forms.CheckboxInput) > > I want to add a onclick

How to add a onclick attribute to a newforms element

2007-10-13 Thread Greg
I have the following form field: s_check = forms.CharField(widget=forms.CheckboxInput) I want to add a onclick attribute to this form field in the template. How is that done in Django? This is how I show the form element in my template: {{ fo.s_check }} Thanks for any help

Re: django debugging eclipse watch variable problem

2007-10-13 Thread johnny
Has anyone able to watch variable in debug mode of eclipse? If so, what your project folder structure. I just have: c:\django\mysite mysite folder contains: apps (contains directories of different apps), manage.py, settings.py, src folder is empty. I have added Inside Eclipse : Window menu

Re: Add Column to ManyToMany Generated Table

2007-10-13 Thread Marty Alchin
Well, you're right that going with a standard model with two ForeignKeys will lose some of the nice functionality associated with Django's ManyToMany field. That's just a fact of life at this point, I'm afraid. :( And no, Django doesn't create a separate class for the m2m table, it just keeps

Re: template variables

2007-10-13 Thread SmileyChris
On Oct 13, 8:35 pm, "Nikola Stjelja" <[EMAIL PROTECTED]> wrote: > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} > > What's the problem. You just send the template 'y':range(1,6). It's very > simple. I don't think the template

Re: Help setting up urls.py to handle predominantly static site

2007-10-13 Thread SmileyChris
On Oct 13, 4:09 pm, Jason <[EMAIL PROTECTED]> wrote: > Hey everyone-- > > I've got a predominantly static site that I need to serve through > Django, at least until I can convert more of it over properly. Yes, I > know this is discouraged, but it's the only way I'm going to be able > to move

Boolean Field strange behaviour ?

2007-10-13 Thread xor exor
Hi list, i have a form that has a Boolean field which actually is in a MultiValueField here is the field : http://dpaste.com/22344/ The the problem is, although i declared the boolean field as not required i got "that field is required" error during the validation when i dont check it. Also i

Re: problem to connect with mysql...

2007-10-13 Thread hern42
Hi again, It is 1.2.2 indeed... But still no luck. I really don't understand as I installed exactly the same package on another machine this afternoon and everything works a charm. Really weird! Cheers, thanks for your interest in that matter Hrn On Oct 13, 5:54 pm, Thejaswi Puthraya <[EMAIL

Re: Getting error: 'unicode' object has no attribute 'strftime'

2007-10-13 Thread Karen Tracey
At 10:35 AM 10/13/2007, Greg wrote: [snip details of change to django code] >That seems to fix the problem. Is the code that I took needed there >for a reason? Will this changed have an effect on how other areas of >my application work? Yes, that code is needed and is there for a reason. The

Re: problem to connect with mysql...

2007-10-13 Thread Thejaswi Puthraya
Hi Hern, [snipped] > I actually tried deinstalling django, py-mysqldb and reinstalling > everything from the ports (that's a freebsd machine...) and it didn't > change anything. Can you give us the version of mysqldb ports is trying to install. Mysqldb >= 1.2.2 is supported. Cheers Thejaswi

Re: django admin -> documentation -> views

2007-10-13 Thread lmierzej
Thank you very much - documentation on django website is little misleading... I thought I would get something 'automagicaly' :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Django issue #4165

2007-10-13 Thread Faheem Mitha
Hi, I've been unable to get the most recent patch from #4165 (http://code.djangoproject.com/ticket/4165) to work. If anyone suggest what I might be doing wrong, or provide a minimal working example, that would be most helpful. My understanding is that #4165 should work more or less out of

Re: Getting error: 'unicode' object has no attribute 'strftime'

2007-10-13 Thread Greg
Ok, I've made some changes and now I'm able to add styles in the admin. However, it required me to change change a django file that I'm not sure I should change. Here is what i changed. In c:\Python24\lib\site-packages\django\db\models\fields\__init__.py and changed the method

Howto read XML files

2007-10-13 Thread tnoo
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 proceed formt there? Thanks, Martin

Re: template variables

2007-10-13 Thread Jeff Forcier
On Oct 13, 3:41 am, Goon <[EMAIL PROTECTED]> wrote: > Ok, but let's say I have a template like {{for x in y}}, and I would > like the x's seperated by commas, but I don't want a comma after the > last one? or better yet cut off after the first 100 characters with a > "..." The key here is that

Re: problem to connect with mysql...

2007-10-13 Thread hern42
hi Thejaswi, > I believe it is MySql and not msql Yeps, soory, I shoud remove my boxing glove when using the keyboard ;) > Going by the error you have got there is a "thread" problem with > MySQLdb's dependencies. Better reinstall it according to your database > configuration. I actually

Re: template variables

2007-10-13 Thread Nikola Stjelja
On 10/13/07, beck917 <[EMAIL PROTECTED]> wrote: > > Maybe use the custom template filters is a nice way~ > > http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters > Yep. The point is: less programming in html, the better. That's the reason most experienced

Re: template variables

2007-10-13 Thread beck917
Maybe use the custom template filters is a nice way~ http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters 2007/10/13, Nikola Stjelja <[EMAIL PROTECTED]>: > > > > On 10/13/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > > > > On 10/13/07, Goon <[EMAIL

Re: template variables

2007-10-13 Thread Goon
On Oct 13, 3:26 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} > > Perhaps the documentation will make you happy: Ok, but let's say I have a template like {{for x in y}}, and I

Re: template variables

2007-10-13 Thread Nikola Stjelja
On 10/13/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} What's the problem. You just send the template 'y':range(1,6). It's very simple. I don't think the template system should

Re: template variables

2007-10-13 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} Perhaps the documentation will make you happy: http://www.djangoproject.com/documentation/templates/#slice -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: template variables

2007-10-13 Thread Goon
fair enough, I'm not happy that I can't get {{for x in y[1:5]}} dammit! --~--~-~--~~~---~--~~ 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

Re: template variables

2007-10-13 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > can you use variables in django's templates? Yes. > and then something like > {% int x =3; x++ %} No. Django's template language is not Python or any other programming language. Its sole purpose is presentational logic. -- "Bureaucrat Conrad,

Re: template variables

2007-10-13 Thread Ramdas S
Simple answer is no. But you can may be try porting mako to to django On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > > can you use variables in django's templates? > > so like {% for x in y %} > > and then something like > > {% int x =3; x++ %} > > or something like that, would be mighty

template variables

2007-10-13 Thread Goon
can you use variables in django's templates? so like {% for x in y %} and then something like {% int x =3; x++ %} or something like that, would be mighty helpful --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups