Skip to content

Commit

Permalink
Update django2.md
Browse files Browse the repository at this point in the history
išėmiau absolute_url, nes nereikalinga
  • Loading branch information
DonatasNoreika authored Jan 22, 2024
1 parent 89c7a82 commit 09f3d4b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Django/MDs2/django2.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ class Book(models.Model):

def __str__(self):
return self.title

def get_absolute_url(self):
"""Nurodo konkretaus aprašymo galinį adresą"""
return reverse('book-detail', args=[str(self.id)])
```

Modelis iš esmės pats save aprašantis. Į ką reikėtų atkreipti dėmesį:
Expand Down Expand Up @@ -104,10 +100,6 @@ class Author(models.Model):
class Meta:
ordering = ['last_name', 'first_name']

def get_absolute_url(self):
"""Returns the url to access a particular author instance."""
return reverse('author-detail', args=[str(self.id)])

def __str__(self):
"""String for representing the Model object."""
return f'{self.last_name} {self.first_name}'
Expand Down

0 comments on commit 09f3d4b

Please sign in to comment.