Hello Andrew, If you sure you have only one object, or the first item is enough to do something in template; You can access value by calling object with index number of the object by {% unique_key_object.0.filename %} usage. If there is no object in unique_key_object, template engine might fail silently.
If you really sure there is only one object will return on each execution of line below unique_key_object = simpleformmodel.objects.all().filter(id=unique_key) Consider changing that line with this: unique_key_object = simpleformmodel.objects.get(id=unique_key) This will fetch only one object if available. If not, it will throw exception. On the toher hand, there are .first() and .last() methods are available with query. If you convert that query to this: unique_key_object = simpleformmodel.objects.filter(id=unique_key).first() or unique_key_object = simpleformmodel.objects.filter(id=unique_key).last() You can get only one object like as querying with .get(), but lack of object is return None instead throwing exception. BTW, you don't need to use .all() if you have to use .filter() or other query methods. Regards, Sencer HAMARAT On Thu, Nov 21, 2019 at 7:18 PM Jim Illback <subaru...@hotmail.com> wrote: > Check out this URL and the embedded Django link in the answers: > https://stackoverflow.com/questions/1700661/how-to-access-array-elements-in-a-django-template. > > > > On Nov 20, 2019, at 10:25 AM, Andrew Stringfield <loneso...@gmail.com> > wrote: > > I have not! I did see something about that on a website. Would it go > something like: dictionary_name.fieldname.0 ? I will try it out later > today. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/f1615df3-04bc-4a28-9914-535c51f13268%40googlegroups.com > . > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/2ACBD58F-2A6D-4E23-AD31-2636D22C9C0A%40hotmail.com > <https://groups.google.com/d/msgid/django-users/2ACBD58F-2A6D-4E23-AD31-2636D22C9C0A%40hotmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACp8TZgbAVpEW_M%2Bpw67TfKYARuuuvoyAHGAC6p%3DOEM7W2Wx7A%40mail.gmail.com.