Hi. I have a problem in get data with press button of database.
this model.py
class BnBar(models.Model):
user_name = models.ForeignKey(Informations_Bi, on_delete=models.CASCADE, blank=True, null=True)
gharardad = models.ForeignKey(Gharardad, on_delete=models.SET_NULL, null=True, blank=True)
barnameid = models.SlugField(unique=True, max_length=50, name="barnameid", null=True, blank=True)
and this is view.py
def Print_ListView(request, idd, slug):
emp = get_object_or_404(BnBar, id=idd, slug=slug)
return render(request, 'print_output.html', {'emp': emp})
and this is urls.py
urlpatterns = [
path('ShowBn/<int:idd>/', Print_ListView, name='printviewss') ]
and I have two html file that first is for table and second is for button
this is list_of_table.html for button print detail
<a class="btn btn-info btn-sm" href="{% url 'barbari:printviewss' idd=emp.id_list %}">print</a>
problem is here.
when press print this is error:
Reverse for ‘printviewss’ with keyword arguments ‘{‘idd’: ‘’}’ not found. 1 pattern(s) tried: [‘ShowBn/(?P[0-9]+)/\Z’]
thanks