Re: Easy question to the Auth System

17 views
Skip to first unread message

Thomas Orozco

unread,
Sep 16, 2012, 1:03:33 PM9/16/12
to django...@googlegroups.com
Hi,

Use ManyToMany if one event can relate to several Users
Use ForeignKey if one event relates to a single User

Cheers,

Thomas

2012/9/16 WoHinDu <domi...@lade.cc>:
> Hey,
>
> sorry for my bad englisch. Englisch is not my nativ language, but i hope you
> can understand it and sorry for the stupid question but i'm new at Django.
>
> I have a table called "Event" in this Table i store some events with title,
> date/time an a description.
>
> But how can i "connect" this events with users from the Django Auth System?
> Is it a good idea to do this with a "ManyToMany" relation or not?
>
> Thanks.
>
> WoHinDu
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/dDvQhsitipgJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

WoHinDu

unread,
Sep 16, 2012, 1:57:41 PM9/16/12
to django...@googlegroups.com
Hey Thomas and everyone,

one event is related to several user and one user can be related to several events.

So i make a Many To Many relation.

Now it looks in the admin interface like the picture attached.
How can i make that only the User who already joined a event be displayed?

Greetings

WoHinDu
DjangoAdmin.png

WoHinDu

unread,
Sep 16, 2012, 2:40:47 PM9/16/12
to django...@googlegroups.com
I love Django. Sometimes it's a bit dificult to find what you need, but if you find it, it's always simpel.

If someone have the same problem just add filter_horizontal or filter_vertical thats all!
Reply all
Reply to author
Forward
0 new messages