Django multiple model from one form submit

41 views
Skip to first unread message

Henrique Oliveira

unread,
Feb 19, 2014, 10:24:25 PM2/19/14
to django...@googlegroups.com
Hi there,

I have the model below:

class Ticket(models.Model):
    REAL = 'R'
    FREE = 'F'
    TYPES = (
        (REAL, 'Real'),
        (FREE, 'Free'),
     )
   amount = models.DecimalField()
    user = models.ForeignKey(User)


class Pick(models.Model):
    ticket_id = models.ForeignKey(Ticket)
    number = models.CharField(max_length=4)

Many Tickets can be created on the same submit depending on the ticket type.

how can do that

i have attached a mockup

Cheers
mockup.png

Jonathan Querubina

unread,
Feb 19, 2014, 10:43:53 PM2/19/14
to django...@googlegroups.com
You can use an admin custom insert form

With stackedinline


Jonathan Querubina
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3d1cdf8-0097-4323-9a4f-660dfc8c7b84%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<mockup.png>
Reply all
Reply to author
Forward
0 new messages