Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Inspecting objects
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonas Geiregat  
View profile  
 More options Jul 13 2011, 2:32 am
From: Jonas Geiregat <jo...@geiregat.org>
Date: Wed, 13 Jul 2011 08:32:01 +0200
Local: Wed, Jul 13 2011 2:32 am
Subject: Re: Inspecting objects
I like to add:

import pdb; pdb.set_trace();

To my code.

Reload the page.

Go to the development server instance. You'll see that the page hangs forever ,since we started the python debugger.
Now you can easily inspect all variables, classes and functions from PDB.
Of course you're not limited to using set_trace().

Good luck !

>> Thank you all for your help!!!

> I know I'm a bit late to the party (blame timezones :), but thought
> I'd put my 2 cents worth in :)

> For inspecting models from command lines (usually when working with
> models from legacy databases) I often use model_to_dict which is
> "hidden" in django.forms.models.

>>>> from django.forms.models import model_to_dict
>>>> print model_to_dict(some_model)

>  HTH

>     Jirka

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Jonas Geiregat
jo...@geiregat.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.