I have model A and model B. Thusly:
class A(models.Model):
...
class B(models.Model):
a = models.ForeignKey(A)
...
Now, a user makes an instance of model A, and from the detail page I want to allow them to click a link to create instances of model B that's attached to the A they just made. Is there an easy way for me to pass to the form for model B what instance of model A (the one the user is looking at) I want to attach it to? There is no reason for the user to know anything about it, and making a hidden field seems to be a bit of a hack, as does putting it as a get variable. Just wondering if there is a smoother way to go about it.