Re: adding field to query set

2010-10-29 Thread Jumpfroggy
If it were my project, I'd probably add this kind of custom field to your mapping: mapping = { # list the normal columns first... then: 'full_name': ['user__first_name', 'user__last_name'], } Then your render code would be something like this: def render(self): for row in sel

Re: adding field to query set

2010-10-28 Thread owidjaya
Ok the motive is for this reason. I have a table generator class that display an html table from the query set depending on the columns that you selected class TableGenerator(name,mapping,data): def __init__(self,name,mapping,data): self._mapping = mapping self._name = name self._

Re: adding field to query set

2010-10-28 Thread Jumpfroggy
What's your motive? Are you worried about performance? If performance is not an issue, you can just do this: for project in Project.objects.all(): print project.user.first_name + ' ' + project.user.last_namea This might speed things up: projects = Project.objects.all().select_r