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:

  1. is right have author userprofile instead? because have entry.author.user.username not intuitive.
  2. might better replace builtin user class custom class has data need?
  3. is right userprofile's following manytomanyfield other userprofile rather user?

since users can follow each other , entries people, makes totally sense make author userprofile both models logically in same level


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -