Compare commits

..

No commits in common. "c1371cdd94b551fc7b1e86db43353f5085d1ed7a" and "a5cfb428182e944a23aee7faabf5921c89458508" have entirely different histories.

5 changed files with 5 additions and 6 deletions

1
.gitignore vendored
View File

@ -2,4 +2,3 @@ venv
.vscode
__pycache__
db.sqlite3
website/db.sqlite3

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ class Snippet(models.Model):
language = models.CharField(choices=LANGUAGE_CHOICES, default='python', max_length=100)
style = models.CharField(choices=STYLE_CHOICES, default='friendly', max_length=100)
owner = models.ForeignKey('auth.user', related_name='snippets', on_delete=models.CASCADE)
highlighted = models.TextField()
highlighted = models.TextField
class Meta:
ordering = ['created']

View File

@ -2,13 +2,14 @@ from django.contrib.auth.models import User
from .models import Snippet
from .serializers import SnippetSerializer, UserSerializer
from snippets.permissions import IsOwnerOrReadOnly
from .permissions import IsOwnerOrReadOnly
from rest_framework import permissions, renderers
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import permissions
class SnippetViewSet(viewsets.ModelViewSet):
"""