Please i am creating a system whereby i have two user types 1. User, 2. Company

Please i am creating a system whereby i have two user types 1. User, 2. Company

I want a company to be able to recruit a user and let it show on the user profile that he is an employee of the company and can be assigned to a team.

Please any idea on how i can do it. I’m new to this please help

First thing this more of a logic work that we our self should solve it.
But anyways I can share my idea to this:

  • First you can list users in your site after filtering it via user_type=1 than a company user can view the list and detail of a particular user.
  • Now for the recruitment part you can create another model which will have 2 Foreign keys to the model say
class Recruitment(models.Model):
    user = models.ForeignKey(UserModel, on_delete=models.CASCADE, related_name="user")
    company = models.ForeignKey(UserModel, on_delete=models.CASCADE, related_name="company")
    # Some other fields you want can be here
  • Now from here on it’s upto you how you want to handle the recruitment process.
  • Also once a user is recruited by a company you can exclude that user from user list in your site
  • To list all the recruited users for a particular company you can filter it from Recruitment model and show them in company’s profile.
1 Like

Sorry Please am very new to alll of this if i may ask how can i handle the recruitment process and also the company can create a team and add the recruited users of the company to the teams how can i do that also.

thank you for your time and attention

You mentioned twice now that you are new to this. How new?
What has your training been:

  • in programming in general?
  • Web design and development?
  • Python?
  • Django?

like a rookie kind of new. Just started learning and wanted to build something

I’m very much a rookie to all fields and been learning by myself

If you have any idea on how i can implement this logic please help

What parts of doing something like this are you already familiar with?

Start with what you know, then break the rest down into smaller steps that you can address one at a time.

For example, how many pages are you thinking this is going to need? What is the function to be performed on each page?

I aim to create a system where a “Company” can recruit “Users” and establish their roles within the company. I’ve encountered challenges in structuring the database models and managing the relationships effectively. Specifically, I’m looking for guidance on how to design the models, set up relationships, and implement user invitations, role assignments, and team associations within the Django framework.

Technically, a “Company” is not a “User”. You may have a “User” who is an employee of a “Company” - and may perform actions on behalf of that company. But the “Company” itself is not a “User”.

“Divide and conquer”

Take this big problem and break it down into a number of smaller, more manageable problems. Pick one functional aspect of your design and get it working first, recognizing and acknowledging that your design will change as you’re working on this, and your understanding of the business issues increases.