[英]how to get item from certain database variable?
models.py:模型.py:
class VideoLibrary(models.Model):
shop_id = models.AutoField(primary_key=True, unique=True)
shop_name = models.CharField(max_length=264)
adress = models.TextField(max_length=264, default='')
I have here shop_name and address.我这里有店名和地址。 The thing I need is to click a button which gets shop_name from text area and match it with address.
我需要的是单击一个按钮,该按钮从文本区域获取 shop_name 并将其与地址匹配。 Is there any way to do it?
有什么办法吗?
as I mentioned I need to get the name of shop from text area and then show its address.正如我提到的,我需要从文本区域获取商店名称,然后显示其地址。
you can simply validate in your form POST view您可以简单地在表单 POST 视图中验证
if request.POST.get('shop_name') == request.POST.get('adress'):
# your code when matched
else
# throw error
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.