from django.db import models

from account.models import User


class Group(models.Model):
    # 群id
    group_id = models.AutoField(primary_key=True)
    # 群名
    group_name = models.CharField(max_length=50, blank=False)
    # 群管理员
    creator = models.ForeignKey(User, on_delete=models.CASCADE, related_name="my_groups")
    # 群成员(多对多）
    member = models.ManyToManyField(User, related_name="joined_groups")

