problem passing var to template tag

2008-08-28 Thread flynnguy
I'm trying to get a list of photos so I can then go through a list. I have the template tag working if I hard code a value but I want to pass an id to it. So here's the relevant parts of my template tag: class PetPhotoListObject(template.Node): def __init__(self, pet_id): self.pet_id

Re: problem passing var to template tag

2008-08-28 Thread flynnguy
Ah, yes, thank you... must have missed that somehow. Guess I didn't read all the way down. Much appreciated. -Chris On Aug 28, 10:42 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 28 août, 13:59, flynnguy <[EMAIL PROTECTED]> wrote: > > > I'm trying to

ModelForm, images and exclude

2008-08-29 Thread flynnguy
I'm probably doing something stupid but this has bugged me all morning. I have a ModelForm form and a view to add info to a Media model I have. This works: class AddPhotoForm(ModelForm): class Meta: model = Media def add_pet_photo(request, pet_id): pet = Pet.objects.get(id=pet_id)

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
l, this time, not so much. -Chris On Aug 31, 12:37 pm, TiNo <[EMAIL PROTECTED]> wrote: > On Fri, Aug 29, 2008 at 6:37 PM, flynnguy <[EMAIL PROTECTED]> wrote: > > .. > > However there are certain fields I want to set manually so I tried > > this: > > cl

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
m, TiNo <[EMAIL PROTECTED]> wrote: > You could check with the pdb debugger where the error is returned, and maybe > you can also see what field is causing the problem. > > On Tue, Sep 2, 2008 at 3:34 PM, flynnguy <[EMAIL PROTECTED]> wrote: > > > Thanks for the tip

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
some more fiddling is needed. -Chris On Sep 2, 12:21 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Sep 2, 4:04 pm, flynnguy <[EMAIL PROTECTED]> wrote: > > > Found out what was causing the error but not why... > > > It seems that when I tell my model to not e

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
the forms.CharField() doesn't seem to work) -Chris On Sep 2, 12:35 pm, flynnguy <[EMAIL PROTECTED]> wrote: > I tried the id thing which didn't seem to work but then when I tried > the null thing I think I found out what is going on. It looks like the > callable save bit for

Re: ModelForm, images and exclude

2008-09-03 Thread flynnguy
ethodon > save_m2m after commit=False. > > And default does not work indeed, 'initial' does however; you pass it when > creating the form instance. > > On Tue, Sep 2, 2008 at 7:49 PM, flynnguy <[EMAIL PROTECTED]> wrote: > > > Ok, some experimentation ha

Re: ModelForm, images and exclude

2008-09-04 Thread flynnguy
True but I wanted to organize my folder a bit because there's not just one photo per pet, there could be quite a lot more than one photo per pet. First, I'd rather not have a million _ at the end of a file because everyone named their file cute1.jpg. Anyway, I got it to work, code below. (It's not

Re: installing django application on non-django website.

2010-01-10 Thread flynnguy
It looks like what you've linked to is a full project. In order to use any part of Django, you need to setup a Django instance. You will need to go configure apache to pass requests going to example.com/weblog/ to Django, specifically your project folder. The url.py folder then handles the rest. -

django-tagging on shared hosting

2010-01-10 Thread flynnguy
So I'm trying to implement tagging on my website and I found the django-tagging project and threw it in my app and it works great... on my laptop. Go to put things up on the server (dreamhost using their new passenger method) and started to run into some issues. I did easy install using --prefix so

Re: django-tagging on shared hosting

2010-01-10 Thread flynnguy
oding while half asleap is usually bad news. -Chris On Jan 10, 11:43 am, Daniel Roseman wrote: > On Jan 10, 3:28 pm, flynnguy wrote: > > > > > So I'm trying to implement tagging on my website and I found the > > django-tagging project and threw it in my app and it works gr

problem with session persistence

2007-07-08 Thread flynnguy
I am building an online test taking type of application and I am having an issue with one of my session variables... The code looks something like this: (A lot removed for brevity) The first time around I do the following to initialize the list: question = Question.objects.order_

Re: problem with session persistence

2007-07-09 Thread flynnguy
Ok, I upgraded to the development version of django and that didn't help. I then started to try and trim out the code so it was of a more manageable size to post here. It's still rather large but if it helps anyone visualize what I'm talking about, here it is: ## test_indexs.html Take the Test

Re: problem with session persistence

2007-07-26 Thread flynnguy
setting the SESSION_SAVE_EVERY_REQUEST to True ) > > Because from this note from Django Session docs: > # Session is modified. > request.session['foo'] = {} > > # Gotcha: Session is NOT modified, because this alters > # request.session['foo'] instead of request.

inspect and multiple primary keys

2006-10-18 Thread flynnguy
I'm trying to inspect my db for mythtv. I'm running into issues with the inspect command because of the 0 date issue, not a problem, I'm just creating the models I need by hand. The issue I am currently running into is the recorded table has two primary keys (chanid and starttime). In searching I

Re: inspect and multiple primary keys

2006-10-19 Thread flynnguy
Russell Keith-Magee wrote: > However, as suggested in the ticket, you can work around the problem > by hand writing the schema yourself (or, in your case, inheriting some > schema from elsewhere), then writing a Django model that replicates > everything in your schema _except_ the mutliple primary

one to many and custom form

2006-11-12 Thread flynnguy
I'm working on a program to keep track of recipes. Thus I have two main tables, a recipe table and an ingredients table. They look roughly like this: (some code taken out for conciseness) class Recipe(models.Model): recipe_name = models.CharField(maxlength=100) directions = models

Updating multiple models with one form submission

2006-11-28 Thread flynnguy
I had a question a while ago about updating multiple models with one form submission but got no responses so I am going to try and reword it and hopefully someone can help me. I have two models, a recipe model and an ingredients model. The ingredient model is simple and just looks like this: cla

Re: Updating multiple models with one form submission

2006-11-28 Thread flynnguy
Thanks yun, it seems I need to look into a custom manipulator. I do have one question though... Can you have an arbitrary number of form fields or do you have to define them all in the manipulator? An example would be if I want to be able to add ingredient fields (with javascript) so I would say

Re: help with pagination and other vars...

2006-12-12 Thread flynnguy
Thanks, this seems to work, now I just have to change the paginator.py template tag to accept a parameter (as the extra_context info doesn't seem to be available to it) -Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog