Monday, April 30, 2012

Django admin site display (None) even when values are non-null/empty

I have been trying a lot but could not make out why it happens,

class FortressUserAdmin(admin.ModelAdmin):    
(. . . , get_my_schema)    
def get_my_schema(self, obj):
= "select prop_val from customer_property where customer_id = %d and property_value like '%%%%SCHEMA%%%%'" % obj.customer_id.customer_id    
= connection.cursor().execute(sql_query).fetch_one()        
print sql_query        
return 1
# return "aditya"
.short_description = 'Schema Instance'

  • why the column values are always (None)
  • why the print 1 or print 'aditya' won't print anything to the console

Screen shot of the column admin site: enter image description here

You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment