Tuesday, May 15, 2012

Re: Required True to Generic Relations

Solution:
http://pastebin.com/011WsfzD
Regards.

On 15 maio, 23:43, Guevara <eguevara2...@gmail.com> wrote:
> Hi all!
>
> I need a required true in Generic Relations.
> Have this code:
>
> # Models
> class Client(Person):
>     addresses = GenericRelation(Address)
>
> class Address(models.Model):
>    # others fields
>     content_type = models.ForeignKey(ContentType)
>     object_id = models.PositiveIntegerField()
>     content_object = generic.GenericForeignKey('content_type',
> 'object_id')
>
> I need create a client with an address in the form.
> The DOC ignore this question.https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#gener...
>
> Regards.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate