[Fixed]-Pass Value from View to controller and display in template

1👍

Do you need just the latest by date or latest by insert into DB? That’s kinda different.

def get_context_data(self, **kwargs):

   latest_id = SiverifyVerificationSiteRevision.objects.latest('date').id  # `latest` method works on date fields.

   # This one gives you latest ID by insert.
   # latest_id = SiverifyVerificationSiteRevision.objects.order_by('-id').first().id

   kwargs['latest_id'] = latest_id
   kwargs['ngapp'] = 'ReviewMod'

   return kwargs

Leave a comment