Model A imports Model B imports Model A - I'm completely lost as to how to get around circular imports

2009-04-05 Thread codecowboy
Hi Everyone, I'm new to the Django community and I am having trouble with circular imports. I've read every article that I can find about the issue including posts on this group. I'm going to paste my model files and the stack trace. I'm sure that this must be an issue that has come up

Re: Model A imports Model B imports Model A - I'm completely lost as to how to get around circular imports

2009-04-05 Thread codecowboy
Doug, Thank you so much. I completely missed that detail while ripping through the django docs. I've got it all working now. Ramiro, thanks again for your help. For anyone else who is trying to do this and stumbles upon this thread, here is my full final solution. --- Overview --- I've got

How can I filter query sets in a django template?

2009-04-05 Thread codecowboy
I posted a question earlier today about circular imports (http:// groups.google.com/group/django-users/t/6119e979131c8c25). I now have a follow question to that. I've got the following view logic. def portal(request): scientist_id = 1 s = get_object_or_404(Scientist, pk=scientist_id)

Re: Form wizard - previous step

2009-04-05 Thread codecowboy
Do you have one view for each form or do you use one view with a large amount of conditional logic (e.g. if stepone then show this form elseif steptwo show this form)? On Apr 5, 1:14 pm, eli wrote: > anybody ? :-) > > regards. > > On 4 Kwi, 11:17, eli

Re: Form wizard - previous step

2009-04-05 Thread codecowboy
s/form-wizar... > > regards. > > On 5 Kwi, 21:52, codecowboy <guy.ja...@gmail.com> wrote: > > > Do you have one view for each form or do you use one view with a large > > amount of conditional logic (e.g. if stepone then show this form > > elseif steptwo show th

Re: How can I filter query sets in a django template?

2009-04-08 Thread codecowboy
Thank you Daniel and Florian (Merci beaucoup. Je parle francais un petit). I think that I will be able to use both templates and custom model methods to accomplish what I am trying. On Apr 5, 4:18 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Apr 5, 8:49 pm, c

Does anyone know how to prepopulate a form with model data

2009-04-08 Thread codecowboy
I want to create a form that allows a user to edit his/her profile. I don't want to bind my form to a model because the form will involve two different models. Does anyone have any ideas. I've read chapter 7 in the Django Book but it only to a simple example that does not help me. Here is

every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
Every time that a load a form on my site, I see the following errors. If I reload the page, they go away and everything works just fine. Does anyone know why? Thank you in advance. TemplateSyntaxError at /eaccounts/register/ Caught an exception while rendering: Tried edit in module

Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
I've read some other posts regarding this issue as well as the following article: http://www.b-list.org/weblog/2007/nov/03/working-models/. I cannot seem to get this thing to work. Thank you in advance for any help. Here is my code. -- view -- from django.db.models import

Re: Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
11, 4:49 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Apr 11, 9:25 pm, codecowboy <guy.ja...@gmail.com> wrote: > > > > > I've read some other posts regarding this issue as well as the > > following article:http://www.b-list.org/weblog/2007/nov/03/work

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
I've followed some examples from around the Django community and that is why I use the reverse() method at all. What is the point of using the reverse() method? On Apr 11, 5:03 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Apr 11, 7:57 pm, codecowboy <guy.ja...@gmai

Is it possible to specify the html class attribute for a form field?

2010-12-11 Thread codecowboy
Thank you in advance for any feedback. Here is what I have {{ form.name }}. I would like to set the class attribute for this form element to "style01". Is this possible? If it is not possible then I have been trying to get this working as well without much luck. I realize that this syntax is