Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

dt

ellington.core.parts.templatetags has the function resolve_literal_or_variable which allows you to pass in your string (which may or may not be a variable) and the context.

// ellington.core.parts.templatetags has the function resolve_literal_or_variable which allows you to pass in your string (which may or may not be a variable) and the context.
// insert code here..

Q: is there a way to call get_list() so that it returns of list elements having a common foreign key?

// is there a way to call get_list() so that it returns of list elements having a common foreign key?

Ref: http://www.djangoproject.com/documentation/0_91/db_api/#relationships-joins


foo.get_list(bar__id__exact=15)
get_list(related_object__id__exact=1)

templatetag test

// description of your code here


a code snippet like that at the bottom of my templatetag file while i def with a if __name__=='__main__': .. that way I can test my tag as i work on them

template.Template("so {% load photogalleries %}") is the same in the .html as it is in Python form... it just makes it easier because you can stick the py code at the end of your template tags file and then run Wing's Debug on that file... That will allow you to set breakpoints within your tags and quickly figure out what's going on with them....


template.Template("everything in this string is treated  just like the contents of your  myfile.html template file")

template.Template("so {% load photogalleries %}"