Re: Creating a custom mixin for use with the generic CreateView

2012-10-05 Thread Guruprasad L
Hi, On Friday, October 5, 2012 3:55:26 AM UTC+5:30, Javier Guerra wrote: > > On Thu, Oct 4, 2012 at 4:55 PM, Guruprasad L > > wrote: > > This is the first time I am using mixins in code. I read mixed opinions > > about mixins, a few of them saying that it is bad. I

Dynamically adding values to related foreign key field in the form

2012-10-05 Thread Guruprasad L
Hi all, Is it possible to add a value for a foreign key field from a form that is actually using it. For example, I have seen in the admin app that whenever there is a foreign key field, there is a way to add new items to that field via a popup window and the added value gets added to the list

Re: Creating a custom mixin for use with the generic CreateView

2012-10-04 Thread Guruprasad L
On Friday, October 5, 2012 3:14:22 AM UTC+5:30, Guruprasad L wrote: > > Hi I have created a Mixin that overrides just the get_form method, to be > used with a class that inherits from CreateView. The Mixin inherits from > object. In my view, when I include CreateView and my mixin i

Creating a custom mixin for use with the generic CreateView

2012-10-04 Thread Guruprasad L
Hi I have created a Mixin that overrides just the get_form method, to be used with a class that inherits from CreateView. The Mixin inherits from object. In my view, when I include CreateView and my mixin in that order, the mixin code doesn't get executed. But when I swap the order of inheritin

Signals and listeners defined in a separate modules unusable in other apps

2011-10-08 Thread Guruprasad L
Hi, I have a django project where I have defined some signals and listeners in a separate module (i.e., in a folder with __init__.py) in the files signals.py and listeners.py. These signals are to be used by multiple applications in the project. So I wrote the code connecting the signal to the l