Re: context dictionary

2016-02-24 Thread Vijay Khemlani
Django 'is' a framework, therefore you have the flexibility to create your context as you see fit. You could call an external API, query your database, obtain results from ElasticSearch, parse another webpage, or anything that suits the needs of your particular project. It completely depends on th

Re: context dictionary

2016-02-24 Thread Malik Rumi
1. is { 5:five, 6:six} and {4:four) two dictionaries, or three? 2. Suppose I had a really long, or large, context, where the key is one of the 50 states and the value is the date of their admission to the Union (of the United States, of course). If that doesn't work, make it nations and the date t

Re: context dictionary

2016-02-23 Thread Andreas Kuhne
True, didn't know that it was active in that way nowadays. To Malik: Don't use user as a key in the dictionary. Regards, Andréas 2016-02-23 16:01 GMT+01:00 : > Wouldn't including the name 'user' in your context dictionary override the > authenticated user object in your template? Might make for

Re: context dictionary

2016-02-23 Thread jorrit787
Wouldn't including the name 'user' in your context dictionary override the authenticated user object in your template? Might make for some unexpected behavior. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: context dictionary

2016-02-23 Thread Andreas Kuhne
Hi, All you have to do is add what you want to the dictionary that you need for your template. There isn't anything "magic" about the context. So for example, if you want to have a model called "user" in the template, you can add it by writing: context = {} context['user'] = User.objects.get(pk=u