Created
June 23, 2020 23:39
-
-
Save walison17/0877c8fa2447e0cebc28e90e43165344 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.conf import settings | |
class Cliente(models.Model) | |
# outros campos | |
cadastrado_por = models.ForeignKey(settings.USER_MODEL, on_delete=models.PROTECT) | |
def index(request): | |
clientes = Cliente.objects.filter(cadastrado_por=request.user) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment