Enter code here...context ={
'person':person,
'scores':scores,
}
Enter code here...<table class="table">
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d05c8fc4-706b-422b-bc11-b656f1950dea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/UlgghbsoqYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTatGSwstRkfEDpZdeB6yMv2BobiaQ_Zb3CEL7ZXr5kE-g%40mail.gmail.com.
No need to change the context, since the variable names the example here uses are the same as your existing context. It should work as long as you remember to {% load APPNAME %}
your filters in the template first.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL5RJ55RzR6MuwXS-ARFKKDb948ijOW9jfp27Th76Xt006%3D_5g%40mail.gmail.com.
{% load APP_NAME %}
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d05c8fc4-706b-422b-bc11-b656f1950dea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/UlgghbsoqYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Thanks Asad. Is that why I'm getting errors saying invalid filter name?
Also I'm having a difficult time thinking my way through the workflow. I'm defining a new function that requires scores(my URL based dictionary) and person (my database dictionary). The function then asks to return the scores of the corresponding game number. Then the template is looking for the correct value in the scores dictionary that has the same Number identification as the existing person.Number?
I think what is confusing me is the use of "player" in ludovics example
Thanks
Aaron
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BYYaWequ_C-hAGkMWWjg1R8MWxXk%3DLwitdP1M92hGGy0B%2BYrg%40mail.gmail.com.
def get_score_for_person(scores, person):
for s in scores:
if s['Number'] == p.Number:
return s['Score']
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d05c8fc4-706b-422b-bc11-b656f1950dea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/UlgghbsoqYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTatGSwstRkfEDpZdeB6yMv2BobiaQ_Zb3CEL7ZXr5kE-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL5RJ55RzR6MuwXS-ARFKKDb948ijOW9jfp27Th76Xt006%3D_5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/UlgghbsoqYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
I hate to be thick but could you explain to me how to load the filters and also how the template should look with the updated function? Solving this will unlock a ton of functionality for my app.
Thanks,
Aaron
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2e91d72f-f6b0-4a63-8fc3-88f58be2ca30%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL5RJ563DQVnJU0Y_MJLOZ_Dfk_qDjrkzwsdLVUkhQTT5QAALw%40mail.gmail.com.
scores_new = {score['Number']:score['score'] for score in scores}
for person in persons: person.update({'score': scores_new.get(person['Number'])})