Re: inlineformset_factory with multiple foreignKeys

2015-10-14 Thread jupiter
No longer need it, please ignore it.

On Wed, Oct 14, 2015 at 9:35 AM, jupiter <jupiter@gmail.com> wrote:

> Hi,
>
> How can the inlineformset_factory be used for multiple following
> foreignKeys at following an example?
>
> class Recipe(models.Model):
> pub_date = models.DateTimeField('Date Published', auto_now_add = True)
> title = models.CharField(max_length=200)
> instructions = models.TextField()
>
> class Ingredients(models.Model):
> pub_date = models.DateTimeField('Date Published', auto_now_add = True)
> title = models.CharField(max_length=200)
> instructions = models.TextField()
>
> class RecipeIngredient(models.Model):
> recipe = models.ForeignKey(Recipe)
> ingredient = models.ForeignKey(Ingredients)
>
>
> ingredientFormSet = inlineformset_factory(Recipe, Ingredients,
> RecipeIngredient) doesn't seem work.
>
> Thank you.
>
> - jup
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAA%3DhcWT0Aety6S%2BEnRgkCWteumjDvKBH59Rx9-%3DbXCNf2idVjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


inlineformset_factory with multiple foreignKeys

2015-10-13 Thread jupiter
Hi,

How can the inlineformset_factory be used for multiple following
foreignKeys at following an example?

class Recipe(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()

class Ingredients(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()

class RecipeIngredient(models.Model):
recipe = models.ForeignKey(Recipe)
ingredient = models.ForeignKey(Ingredients)


ingredientFormSet = inlineformset_factory(Recipe, Ingredients,
RecipeIngredient) doesn't seem work.

Thank you.

- jup

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAA%3DhcWSsR%2B1j1aL0n_XUMEEmWm%2BJRXFPuPX9FGNjkZpJsNr7Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.