Created
June 23, 2020 23:39
-
-
Save walison17/1acec82f47d8ac8c8a9e9a2d9f7b44a4 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