我有一个场景,当一个表的一个字段的值出现在另一个表中时,我应该显示一个图像。我不确定这种情况怎么办。有人可以帮忙吗?在HTML或甚至在angularjs。为了更好地理解,我的代码用html和我试图做的,
HTML:
{% if {{vio.pdb_pid}} }
{% if is_secure_device == 'true'%}
{% verbatim %}
<img class="img-rounded" ng-src="{{vio.pdb_pattern_img}}">
{% endverbatim %}
具有{{vio.pdb_pid}}值的模型:
class OrcPattern(models.Model):
pdb_id = models.IntegerField(null=True, blank=True)
另一张表的模型:
class SiverifyVerificationSite(models.Model):
pattern_id = models.IntegerField(null=True, blank=True)
我在code.i.e中的第一行。 if语句不完整。应在名为{{vio.pdb_pid}}
的表上检查值sivorcdds(the field name in this table is pdb)
。确切地说,如果pattern_id.SiverifyVerificationSite(fieldname.tablename)中存在{{vio.pdb_pid}}
,我应该在我的代码中显示一个图像。我不知道该怎么做。我是编码的新手。任何帮助将不胜感激。
注意:这两种型号具有不同的应用。