django - Should Entry.author be a ForeignKey to User or UserProfile? -
in django, want filter queryset
using list of user
s active user following
.
i've opted extend user
class rather replace custom class, although i'm not sure right choice.
hence have userprofile
class, has manytomanyfield
other userprofiles, , onetoonefield
user
.
my queryset
looks entry.objects.filter(author__in=request.user.userprofile.following.all())
author
foreignkeyfield
user
rather userprofile
, i'm change entry.author
point userprofile
s instead.
so questions are, in decreasing priority:
- is right have
author
userprofile
instead? because haveentry.author.user.username
not intuitive. - might better replace builtin
user
class custom class has data need? - is right
userprofile
'sfollowing
manytomanyfield
otheruserprofile
ratheruser
?
since users can follow each other , entries people, makes totally sense make author userprofile both models logically in same level
Comments
Post a Comment