I know it's not true what's in the code how i can return the usernames that the api is linked to
To view in the admin page
from django.db import models
from django.contrib.auth.models import User
class api(models.Model):
user = models.ManyToManyField(User)
api_key = models.CharField(max_length=120)
def __str__(self):
return f"api key for: {self.user.username}"