0
I’m trying to add a Slug that converts the date to a tip that html accepts, but I don’t know how to make it work.
on the models.py part
class Por_dia(models.Model):
pedidos = models.CharField(max_length=30, default='11')
dia = models.DateTimeField()
and in the views part I set a fixed date only for testing but now I wish it could read the day the user select from a Slug.
def home4(request, data):
data= '2018-06-11'
usr= Pedidos.objects.filter(dia=data)
context ={'lista_por_dia' : usr}
return render(request,'por_dia.html', context)
But not without very well how to declare and make Sug become the variable "variable"
Hello! Edit the content of your question and add your code, what you’ve done so far, and your questions about what’s wrong with your code. I recommend touring through the help content: https://answall.com/tour - Greetings.
– Fabiano Monteiro
What you mean by " select user from a Slug"?
– Sidon