On 8/4/06, Ian Clelland <[EMAIL PROTECTED]> wrote:
>
> On 8/3/06, cyberco <[EMAIL PROTECTED]> wrote:
> >
> > OK, but what to do with the following in case of 2 models:
> >
>
> In the past, I've made a custom manipulator in situations like this.
> Something like this (WARNING: Untested code ahead!)
On 8/3/06, cyberco <[EMAIL PROTECTED]> wrote:
>
> OK, but what to do with the following in case of 2 models:
>
In the past, I've made a custom manipulator in situations like this.
Something like this (WARNING: Untested code ahead!) might work for
you:
class CustomManipulator(forms.manipulator):
OK, but what to do with the following in case of 2 models:
===
new_data = request.POST.copy()
errors = manipulator.get_validation_errors(new_data)
if not errors:
manipulator.do_html2python(new_data)
==
The complete method is:
===
def new(request):
manipulato
On 8/3/06, cyberco <[EMAIL PROTECTED]> wrote:
>
> Yes, but I want only one 'submit' button on the html page. This means
> that the POST data goes to one 'view' method. How can I first create an
> instance of A and then an instance of B (with A's id) with the same
> POST data?
>
>
You can put two m
Yes, but I want only one 'submit' button on the html page. This means
that the POST data goes to one 'view' method. How can I first create an
instance of A and then an instance of B (with A's id) with the same
POST data?
--~--~-~--~~~---~--~~
You received this mes
On 8/3/06, cyberco <[EMAIL PROTECTED]> wrote:
>
> I want to enable users to fill out two forms (textareas) on one page,
> where each form creates a new instance of a model/class. I have the 2
> following models:
>
>
> class A(models.Model):
> text = models.TextField()
I want to enable users to fill out two forms (textareas) on one page,
where each form creates a new instance of a model/class. I have the 2
following models:
class A(models.Model):
text = models.TextField()
class B(models.Model):
a = models.ForeignKey(A)
text
7 matches
Mail list logo