text: import uuid
  import os
  
  from django.db import models
  from django.contrib.auth.models import AbstractBaseUser
  from django.contrib.auth.models import BaseUserManager
  from django.contrib.auth.models import PermissionsMixin 
  from django.conf import settings
  
  
  def business_image_file_path(instance, filename):
      """ Generate file path for new business image """
      ext = filename.split('.')[-1]
      filename = f'{uuid.uuid4()}.{ext}'
      return os.path.join('uploads/business/', filename)
  
  
  class UserProfileManager(BaseUserManager):
      """ Manager for user profile """
      def create_user(self, email, name, password=None):
          """ Create a new user profile """
          if not email:
              raise ValueError('User must have an email address')
      
          email = self.normalize_email(email)
          user = self.model(email=email, name=name)
          
          user.set_password(password)
          user.save(using=self._db)
  
          return user
  
      def create_superuser(self, email, name, password):
          """ Create a superuser """
          user=self.create_user(email, name, password)
          user.is_superuser = True
          user.is_staff = True
          user.save(using=self._db)
  
          return user
  
  
  class UserProfile(AbstractBaseUser, PermissionsMixin):
      """ Database model for users in the system """
      email = models.EmailField(max_length=255, unique=True)
      name = models.CharField(max_length=255)
      is_active = models.BooleanField(default=True)
      is_staff = models.BooleanField(default=False)
  
      objects = UserProfileManager()
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['name']
  
      def get_full_name(self):
          """ Retrieve full name of user """
          return self.name
  
      def get_short_name(self):
          """ Retrieve short name of user """
          return self.name
  
      def __str__(self):
          """ Return string representation of user """
          return self.email
  
  
  class Tag(models.Model):
      """ Tag to be used for business department """
      name = models.CharField(max_length=255)
      user = models.ForeignKey(
          settings.AUTH_USER_MODEL,
          on_delete=models.CASCADE
      )
  
      def __str__(self):
          return self.name
  
  
  class Task(models.Model):
      """ Task to be used in a business process """
      name = models.CharField(max_length=255)
      user = models.ForeignKey(
          settings.AUTH_USER_MODEL,
          on_delete=models.CASCADE
      )
  
      def __str__(self):
          return self.name
  
  
  class Business(models.Model):
      """ Business object """
      user = models.ForeignKey(
          settings.AUTH_USER_MODEL,
          on_delete=models.CASCADE
      )
      title = models.CharField(max_length=255)
      task = models.ManyToManyField('Task')
      tag = models.ManyToManyField('Tag')
      image = models.ImageField(null=True, upload_to=business_image_file_path)
  
      def __str__(self):
          return self.title