Upstart script

2010-09-18 Thread Bret W
Does anyone have an upstart script that they use with manage.py runfcgi? I have come up with the one below, but it hangs when I try to start it. I've tried other scripts, but they either spawn lots of instances or don't respawn when the main instance dies. Any help would be appreciated. #

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
wow, thanks a alot guys for those efforts. indeed, that explanation is better than the original docs :) . I get it now, I changed it, and I guess the data model (v1.0 ...) is sufficient for the first test run. it's nice btw to get such a good support here in the forums! this is not granted at

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Steve Holden
On 9/18/2010 3:23 PM, werefr0g wrote: > Hello, > > I was quite laconic previously in order to spare you my "english". Sorry > if you found this rude. > > Well, you describe the relashionship from one model perspective (Meal) > while setting your field (side1).By setting Field side1 in Meal as >

Re: need help with admin list images

2010-09-18 Thread Bobby Roberts
woohoo... thanks karen! On Sep 18, 6:20 pm, Karen Tracey wrote: > On Sat, Sep 18, 2010 at 6:16 PM, Bobby Roberts wrote: > > only thing that does is return this: > > > > width="65"/> > > > I need the image to show rather than just the html for the image.

Re: need help with admin list images

2010-09-18 Thread Karen Tracey
On Sat, Sep 18, 2010 at 6:16 PM, Bobby Roberts wrote: > only thing that does is return this: > > width="65"/> > > > > I need the image to show rather than just the html for the image. > You need to move the xx.allow_tags out to the same indentation level as the def xx. It

Re: need help with admin list images

2010-09-18 Thread Steve Holden
Read up on the concept of "safe" markup: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escaping regards Steve On 9/18/2010 6:16 PM, Bobby Roberts wrote: > only thing that does is return this: > > width="65"/> > > > > I need the image to show rather than

Re: need help with admin list images

2010-09-18 Thread Bobby Roberts
only thing that does is return this: I need the image to show rather than just the html for the image. any ideas. On Sep 18, 6:07 pm, Wai Yi Leung wrote: > Try: > > > > > class PartnerAdmin(admin.ModelAdmin): > >        list_display = ('xx','AdminTag',) > >        

Re: need help with admin list images

2010-09-18 Thread Wai Yi Leung
Try: > > class PartnerAdmin(admin.ModelAdmin): >list_display = ('xx','AdminTag',) >search_fields = ['AdminTag','Title','Description'] > >def xx(self, instance): >return '' % > (instance.Thumbnail) >xx.allow_tags=True Since the admin

need help with admin list images

2010-09-18 Thread Bobby Roberts
in my model i have an image field as such: Thumbnail= models.ImageField(upload_to="images/partners/ thumbs/", blank=False) I want the thumbnail to show in my admin list. My admin class looks like this below: class PartnerAdmin(admin.ModelAdmin): list_display =

Re: Relationship question: What do I do wrong?

2010-09-18 Thread werefr0g
Hello, I was quite laconic previously in order to spare you my "english". Sorry if you found this rude. Well, you describe the relashionship from one model perspective (Meal) while setting your field (side1).By setting Field side1 in Meal as models.ForeignKey, you state that a Meal has a

Re: In admin, is there a post-commit hook that is executed after all models and inlines are saved?

2010-09-18 Thread jonathan.morgan
One clarification: I think I read somewhere that django handles transactions on a per-request basis. So, there probably isn't a post- commit hook. If the instances were kept up to date, though, there could be a post-all-updates hook... On Sep 18, 12:54 pm, "jonathan.morgan"

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
thanks for all the explanations! i had a look into the database tables - and they do just what i expected. so I just leave it at changing the referal property names ... thanks & greetings, Axel. 2010/9/18 bruno desthuilliers > On 18 sep, 16:23, Axel Bock

In admin, is there a post-commit hook that is executed after all models and inlines are saved?

2010-09-18 Thread jonathan.morgan
Hello, In brief, does anyone know of a way to hook code into the save in the admin so that it executes after the main model and any relations created because of inlines are committed to the database? I don't necessarily need it to give me a re-loaded model instance, but I would at least like to

Re: Error loading MySQLdb module with virtualenv (Virtual Python Environment builder)

2010-09-18 Thread Jagdeep Singh Malhi
> Have you created the virtual environment by using the --no-site-packages > command line switch to virtualenv? yes , me using -no-site-packages command > If so, no globally installed module/packages > (among them MySQLdb) will be inherited by the environment. > If you are starting, I'd suggest

Re: Relationship question: What do I do wrong?

2010-09-18 Thread bruno desthuilliers
On 18 sep, 16:23, Axel Bock wrote: > 2010/9/18 bruno desthuilliers > > Django automatically build the "reverse" relationship from SideLists > > (which should be renamed "Side" IMHO) to Meal, using the default > > can I prevent this? Prevent

Re: Multi-table + Abstract Model Inheritance

2010-09-18 Thread ringemup
Well, on the surface this works. I'm sure if anything unexpected happens I'll be back. On Sep 17, 8:34 am, ringemup wrote: > Sure, it's easy enough to find out if it works in a general sense -- > but I'm also concerned about running into subtle bugs down the road, > and

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
2010/9/18 bruno desthuilliers > > On 18 sep, 08:26, Axel Bock wrote: > > Now I get an error when compiling this. > > s/compiling/importing/ > yah, all right :) . > > Any help here? I'm quite new to dango, so a little hint would be > >

Re: Relationship question: What do I do wrong?

2010-09-18 Thread bruno desthuilliers
On 18 sep, 08:26, Axel Bock wrote: > Hello, > > I am currently experimenting with a little webapp, and I have the > following problem. I want to assign two properties of the same type to > a class. (Stupid) Example: I have a meal, and it comes with two sides. > The sides

Re: IE9 and dev server errors

2010-09-18 Thread Shamail Tayyab
Hi, I too face this problem, in my case its necessarily IE6, haven't tested with other IE's. I am using MacOSX snow leopard on python 2.5.4 and what I get is a BrokenPipe exception. Once I get this, the server does not continue, unless I start it again manually. As a work around, I've set up

Re: IE9 and dev server errors

2010-09-18 Thread Ramiro Morales
On Fri, Sep 17, 2010 at 8:11 PM, TheIvIaxx wrote: > Hello all, I just downloaded the IE9 beta to see if everything worked > as expected.  However when going to 127.0.0.1 with IE9 using the > django dev server, i get: > > [Errno 10054] An existing connection was forcibly

Re: Error loading MySQLdb module with virtualenv (Virtual Python Environment builder)

2010-09-18 Thread Ramiro Morales
On Sat, Sep 18, 2010 at 2:08 AM, Jagdeep Singh Malhi wrote: > I am using virtualenv 1.5 to install multiple version of django in > same PC. > My Django is works fine with virtualenv, follow this link > http://pypi.python.org/pypi/virtualenv#downloads > but me face problem

Re: Relationship question: What do I do wrong?

2010-09-18 Thread werefr0g
Axel, You should use "related_name" attribute in your models.ForeignKey fields. Regards Le 18/09/2010 08:26, Axel Bock a écrit : Hello, I am currently experimenting with a little webapp, and I have the following problem. I want to assign two properties of the same type to a class. (Stupid)

Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
Hello, I am currently experimenting with a little webapp, and I have the following problem. I want to assign two properties of the same type to a class. (Stupid) Example: I have a meal, and it comes with two sides. The sides itself are another database key - they can change on a whim :) . It

Re: Tying a model to a specific database using the model's meta data?

2010-09-18 Thread Preston Holmes
On Friday, September 17, 2010, Stodge wrote: > I have a bunch of models and I want to specify which models (tables) > are stored on which PostgreSQL database. I've read the documentation > and I know I can use the using() function. I'm just wondering this > can't be specified in

Re: IE9 and dev server errors

2010-09-18 Thread Prashanth
Hi, On Sat, Sep 18, 2010 at 4:41 AM, TheIvIaxx wrote: > Hello all, I just downloaded the IE9 beta to see if everything worked > as expected. However when going to 127.0.0.1 with IE9 using the > django dev server, i get: > > [Errno 10054] An existing connection was forcibly