https://stackoverflow.com/questions/8252387/how-do-i-access-dictionary-keys-that-contain-hyphens-from-within-a-django-templa

On Mon, Jun 20, 2022 at 07:52:46AM -0700, Koushik Romel wrote:
> When trying to get a value from restapi in for loop to display it takes 
> hyphen(-) as minus(-). And there is no way to change the api structure 
> because it is fixed.
> Im struck in this anyone help me..
> The exact error and the expected json is given below is down below
> 
> when i try to print {{key}} the whole for loop data it displays like this
> {'_id': ObjectId('xxxxxxxxxxx'), 'date': 'jun/20/2022', 'dst-active': 
> 'false', 'gmt-offset': '+05:30', 'time': '20:19:04', 
> 'time-zone-autodetect': 'true', 'time-zone-name': 'Asia/Kolkata'}
> 
> when i specify {{key.dst-active}} it throws this error
> TemplateSyntaxError at /store/Could not parse the remainder: '-active' from 
> 'key.dst-active'

-- 
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/20220623134418.GE18918%40fattuba.com.

Reply via email to