django - Should Entry.author be a ForeignKey to User or UserProfile? -
in django, want filter queryset using list of users 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 userprofiles instead.
so questions are, in decreasing priority:
- is right have
authoruserprofileinstead? because haveentry.author.user.usernamenot intuitive. - might better replace builtin
userclass custom class has data need? - is right
userprofile'sfollowingmanytomanyfieldotheruserprofileratheruser?
since users can follow each other , entries people, makes totally sense make author userprofile both models logically in same level
Comments
Post a Comment