Re: Can a template extend a template?

2011-12-13 Thread Ian Clelland
On Tue, Dec 13, 2011 at 2:21 PM, Jason <1jason.whatf...@gmail.com> wrote: > Hi there, > > I love the concept of DRY, and django's enthusiasm for this concept. In > light of this I have tried to have a template extend a template, but it > doesn't seem to work. Is there a better way than what I'm cu

Re: Newbie question - if I add "on delete cascade" to a foreign key on my MySQL db

2011-12-13 Thread Mike
Many thanks Jacob! On Dec 13, 8:57 pm, Jacob Kaplan-Moss wrote: > On Tue, Dec 13, 2011 at 7:22 PM, Mike wrote: > > will I still be able to use Django's ORM? > > Yes, please > seehttps://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.mo... > and in particular DO_NOTHING. > > Jacob -

Re: Newbie question - if I add "on delete cascade" to a foreign key on my MySQL db

2011-12-13 Thread Jacob Kaplan-Moss
On Tue, Dec 13, 2011 at 7:22 PM, Mike wrote: > will I still be able to use Django's ORM? Yes, please see https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete and in particular DO_NOTHING. Jacob -- You received this message because you are subscribed to

Newbie question - if I add "on delete cascade" to a foreign key on my MySQL db

2011-12-13 Thread Mike
will I still be able to use Django's ORM? TIA -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegrou

Re: Can a template extend a template?

2011-12-13 Thread Furbee
Brilliant! I wasn't looking an answer to this question, and wasn't all that aware of how these interacted, but it will sure come in handy. Thanks for the extremely clear, concise explanation. I don't think the Django docs make it quite that clear. Furbee On Tue, Dec 13, 2011 at 3:49 PM, Russell K

Re: Can a template extend a template?

2011-12-13 Thread Russell Keith-Magee
On Wed, Dec 14, 2011 at 6:21 AM, Jason <1jason.whatf...@gmail.com> wrote: > Hi there, > > I love the concept of DRY, and django's enthusiasm for this concept. In > light of this I have tried to have a template extend a template, but it > doesn't seem to work. Is there a better way than what I'm cur

Re: Can a template extend a template?

2011-12-13 Thread Gabriel [SGT]
On Tue, Dec 13, 2011 at 7:21 PM, Jason <1jason.whatf...@gmail.com> wrote: > Hi there, > > I love the concept of DRY, and django's enthusiasm for this concept. In > light of this I have tried to have a template extend a template, but it > doesn't seem to work. Is there a better way than what I'm cur

Can a template extend a template?

2011-12-13 Thread Jason
Hi there, I love the concept of DRY, and django's enthusiasm for this concept. In light of this I have tried to have a template extend a template, but it doesn't seem to work. Is there a better way than what I'm currently doing? The current way index.html {% if current_user %} {% ext

Re: Decorator aware Django

2011-12-13 Thread Bernardo
Hi Russel, > Returning HTTPResponse also provides a data formatting constraint that > your approach doesn't have. At each level of Django view, you know > you're going to get a HTTP Response. Yes, now it makes sense the view working only with HTTP request and responses and the decorators will on

foreign key select widget with "add" link

2011-12-13 Thread j_syk
I have a Model with a ForeignKey and I'm using a vanilla ModelForm, so it's using the standard ModelChoiceField widget. I'm looking to add a '+' icon with a link to popup and new window to add a new foreign key that is not already in the dropdown list. Yes, exactly like the admin forms. I've done

Re: How to change the representation of newline?

2011-12-13 Thread Furbee
Yes, it is hard to determine the question. However, a stab in the dark, you are trying to get a tag to display a new line in a django template? If so, any HTML that you want to render on the display needs to be passed with the mark_safe() function. For example in views.py from django.utils.safest

Re: Is DJango bad for conveying business-logic?

2011-12-13 Thread Tomek Paczkowski
In my experience the only thing that locks you in Django is not realizing it's just Python and it's just programming. Use patterns and best practices. Don't think of models as be-all and end-all business logic. Plan wisely and you'll be good. -- You received this message because you are subscr

Is DJango bad for conveying business-logic?

2011-12-13 Thread Alec Taylor
Good morning, I am almost 100% locked in to DJango for the projects I have been planning. The final "myth" I'd like to "dispel" is that DJango is "mediocre" at conveying business-logic. Direct quote by Peter Shangov: Whatever your choice of framework your real-life needs will very quickly outgr

Re: Decorator aware Django

2011-12-13 Thread Javier Guerra Giraldez
hi, Russel explained the real reasons of why your proposal doesn't fit so good in Django. still, this snippet: On Mon, Dec 12, 2011 at 7:49 PM, Bernardo wrote: >        - The framework, within reason, should deduce as much as > possible from as little as possible. >    That last phrase tells e

Re: Django testing and unique=True

2011-12-13 Thread Karen Tracey
On Tue, Dec 13, 2011 at 8:33 AM, Acruax wrote: > Hi, > I have a problem with model testing. My test fails with error: > IntegrityError: duplicate key value violates unique constraint > "catalog_name_key" > DETAIL: Key (name)=(test_catalog1) already exists. > > I have unique=True on name

Django testing and unique=True

2011-12-13 Thread Acruax
Hi, I have a problem with model testing. My test fails with error: IntegrityError: duplicate key value violates unique constraint "catalog_name_key" DETAIL: Key (name)=(test_catalog1) already exists. I have unique=True on name field. class CatalogTestCase(unittest.TestCase): def s

Re: get_FOO_display

2011-12-13 Thread Mike Dewhirst
Absolutely. I went back and found where I had made it work previously and that is exactly what I did. I just had a (hopefully) temporary blur. Thanks Mike On 13/12/2011, at 8:47 PM, Ilian Iliev wrote: > Or you can change your field to IntegerField instead of CharField if you are > planning

Re: get_FOO_display

2011-12-13 Thread Ilian Iliev
Or you can change your field to IntegerField instead of CharField if you are planning to have only Integer values for the choices. -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Dec 13, 2011 at 9:53 AM, Mike Dewhirst wrote: > On 1

Re: How to change the representation of newline?

2011-12-13 Thread Tom Evans
2011/12/13 Germán : > Has anybody solved this issue? > > On Dec 14 2006, 2:47 pm, "Aidas Bendoraitis" > wrote: >> I ran out of ideas. :) Maybe somebody else has any thoughts regarding new >> lines? >> >> Good luck with Django! >> Aidas Bendoraitis [aka Archatas] >> >> On 12/14/06, zhongke chen w