Kim Majali wrote on 06/06/2022
class VideoChannel(models.Model):
user=models.ForeignKey(User,on_delete=models.CASCADE)
name=models.CharField(max_length=200)
detail=models.TextField()
def __str__(self):
return self.name
Read moreKim Majali wrote on 06/06/2022
Author.objects.order_by('name')
Book.objects.order_by('author__name')
Author.objects.order_by('-name')
Author.objects.order_by('-name', 'city')
Author.objects.order_by('?')
Author.objects.order_by(Lower('name'))
Author.objects.order_by()
Author.objects.order_by('name').order_by('city')
queryset = my_queryset.reverse()[:5]
queryset = Author.objects.distinct()
Read moreKim Majali wrote on 06/06/2022
Kim Majali wrote on 06/06/2022
def some_view(request):
if request.method == "POST":
form = some_form(request.POST)
if form.is_valid():
Read moreKim Majali wrote on 06/06/2022
if scorm.objects.filter(Header__id=qp.id).exists(): # does not work with get
Read moreTopics: Views