html - How to check for a value if it exists in a different database table -
i have scenario should display image when value of 1 field of table present in table. i'm not sure how condition can done. can help? in html or in angularjs. better understanding, code in html , i'm trying do,
html:
{% if {{vio.pdb_pid}} } {% if is_secure_device == 'true'%} {% verbatim %} <img class="img-rounded" ng-src="{{vio.pdb_pattern_img}}"> {% endverbatim %}
model has {{vio.pdb_pid}} value:
class orcpattern(models.model): pdb_id = models.integerfield(null=true, blank=true)
model of other table:
class siverifyverificationsite(models.model): pattern_id = models.integerfield(null=true, blank=true)
my first line in code.i.e. if statement incomplete. value {{vio.pdb_pid}}
should checked on table called sivorcdds(the field name in table pdb)
. precisely, if {{vio.pdb_pid}}
exists in pattern_id.siverifyverificationsite(fieldname.tablename)` should display image in code. don't know how this. i'm new coding. appreciated.
note: 2 models of different applications.
Comments
Post a Comment