Just quoting the Django docs here:

"To refer to models defined in another application, you can explicitly
specify a model with the full application label."

https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey


On Mon, May 26, 2014 at 8:18 PM, Shaunak Sinha <[email protected]>wrote:

> Hey Guys,
>
> This is may seem like a very broad question but how do you create a
> foreign key to Gallery in Activity model...
>
> I wrote this line in my Activity model: *activity_gallery =
> models.ForeignKey("Gallery", null=True, blank=True,
> related_name="ActivityImages")*
>
> When I drop my database and re-create it, there is an error which shows
> up. I can't seem to be able to resolve it.
>
> *File
> "/Users/shaunaks/Documents/MyProjects/AGToysVE/lib/python2.7/site-packages/django/db/models/fields/related.py",
> line 1227, in get_default*
> *    if isinstance(field_default, self.rel.to <http://self.rel.to>):*
> *TypeError: isinstance() arg 2 must be a class, type, or tuple of classes
> and types*
>
> Please help!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to