True, but it took me some figuring out and there's still some 'spaghetti'.
The import of models was needed on more then one place (next to views.py)
because of the meta class.
myforms.py:
from models import *
class CustomerForm(ModelForm):
class Meta:
model = Customer
Regards,
G
if im moving my form related logic to another file, i wouldnt really
need to import forms else where? ;)
On Aug 23, 9:10 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Sat, Aug 23, 2008 at 8:59 PM, Julien Phalip <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > In Django there are no 'standar
Julien,
It's working. It took some shuffling of import statements because I subclass
ModelForm in there for use with form.as_table
Anyway, thanx again!
Regards,
Gerard.
Julien Phalip wrote:
> The import is likely to be in your view:
>
> # views.py
> from forms import MyForm
>
> myview(requ
The import is likely to be in your view:
# views.py
from forms import MyForm
myview(request):
if request.method == 'POST':
form = MyForm(request.POST)
...
That's assuming that views.py and forms.py are at the same level.
Cheers,
Julien
On Aug 23, 11:25 pm, Gerard Petersen <[E
Julien/Russell,
Thanx for the info. Working around the name class would simply be resolved by a
'myforms.py' (or something). One thing is still missing in my brain though. If
I put it in a myforms.py. How does Django (or my code if you will) knows where
to find this class. There should be an i
On Sat, Aug 23, 2008 at 8:59 PM, Julien Phalip <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> In Django there are no 'standard' as such. You'd talk more about
> 'conventions'.
> One common way is to put all your forms in forms.py. But that's just
> for cleanliness.
While this is a common convention, I wo
Hi,
In Django there are no 'standard' as such. You'd talk more about
'conventions'.
One common way is to put all your forms in forms.py. But that's just
for cleanliness. Python lets you create whatever architecture you like
for your apps. So, basically, do whatever you feel most comfortable
with
7 matches
Mail list logo