Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8442549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:52:19+00:00 2026-06-10T08:52:19+00:00

I am using django models to create my database . here is my User

  • 0

I am using django models to create my database .

here is my User Class

class User(models.Model):
    user_name = models.CharField(max_length=100,null = False)   
    first_name = models.CharField(max_length=100)
    middle_name = models.CharField(max_length=100)
    last_name = models.CharField(max_length=100)
    tags = here what to do ? 

now i am planning to add tags for User so that user can select the tags (it can be more then one also )
Here is my Tags Class

Class Tags(models.Model)

   tag = models.CharField()

my question is which relation should i use for the reference Tags from User table (Foreign key or Manytomany )

Note: In future i will search the users based on tags so please suggest me the better way to do this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:52:20+00:00Added an answer on June 10, 2026 at 8:52 am

    Use a ManytoMany relationship: different users may use the same tags and a single User will have several tags:

    tags= models.ManyToManyField(Tags, verbose_name="list of tags")
    

    Anyway, you don’t have to implement a Model for the User, there is a User model that comes with django. See the docs:

    • Django docs
    • Django book
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a Django model I'm using. class Person(models.Model): surname = models.CharField(max_length=255, null=True, blank=True)
I'm using django.contrib.admin in one of my apps. my models: class Gallery(models.Model): location =
I have a models.DateTimeField() field in my django model. I am using backbone to
Consider the following django model from django.db import models from django.contrib import auth class
Consider the following model: class FPModel(models.Model): # The user who created author = models.ForeignKey(auth.models.User,
I'm trying mock out a save method call on a django models.Model. I'm using
I am using pdb (actually ipdb ) to debug my Django models.py . In
I have a REST API using Django Tastypie. Given the following code The models
I am trying to implement a to-do-list website to practice using Django. In models.py,
I'm trying to order models in a Django app using a field that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.