Re: Inspecting objects

2011-08-11 Thread Cal Leeming [Simplicity Media Ltd]
Temporarily added to this to https://code.djangoproject.com/wiki/UsingTheMailingList Can be split into its own page another day On Wed, Jul 13, 2011 at 12:58 PM, Cal Leeming [Simplicity Media Ltd] wrote: > You know, I think that this subject deserves it own page on the wiki. I'll > get something

Re: Inspecting objects

2011-07-13 Thread Cal Leeming [Simplicity Media Ltd]
You know, I think that this subject deserves it own page on the wiki. I'll get something started later :) On Wed, Jul 13, 2011 at 7:33 AM, Jonas Geiregat wrote: > > Op 13-jul-2011, om 08:25 heeft Jirka Vejrazka het volgende geschreven: > > >> Thank you all for your help!!! > > > > I know I'm a b

Re: Inspecting objects

2011-07-12 Thread Jonas Geiregat
Op 13-jul-2011, om 08:25 heeft Jirka Vejrazka het volgende geschreven: >> 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

Re: Inspecting objects

2011-07-12 Thread Jonas Geiregat
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

Re: Inspecting objects

2011-07-12 Thread Jirka Vejrazka
> 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.

Re: Inspecting objects

2011-07-12 Thread Lukich
Thank you all for your help!!! -- 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+unsubscr...@googlegroups.com. For more

Re: Inspecting objects

2011-07-12 Thread Andre Terra
You should actually use dir() or vars() rather than __dict__. Here's a thorough explanation, along with an example serializer which might need to access an object's attributes: http://blog.enterthefoo.com/2008/08/pythons-vars.html Regards, André Terra On Tue, Jul 12, 2011 at 4:52 PM, Marc Aym

Re: Inspecting objects

2011-07-12 Thread Marc Aymerich
On Tue, Jul 12, 2011 at 7:25 PM, Lukich wrote: > Hi.  I have just started diving into Django and this question came up > - is there a way for me to examine all the attribute values of an > object?  In Rails there's such a thing as debug statement which spits > out all the details about the object.

Re: Inspecting objects

2011-07-12 Thread Andre Terra
Useful, if the code is well documented: http://www.java2s.com/Code/Python/Utility/CheapandsimpleAPIhelper.htm IIRC, use it like: from apihelper import info info(object, spacing=20) Cheers, André On Tue, Jul 12, 2011 at 2:44 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedial

Re: Inspecting objects

2011-07-12 Thread Cal Leeming [Simplicity Media Ltd]
In fact, if anyone wants to extend on this concept, I'd be more than happy to provide some assistance :) On Tue, Jul 12, 2011 at 6:39 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > > > On Tue, Jul 12, 2011 at 6:25 PM, Lukich wrote: > >> Hi. I have just s

Re: Inspecting objects

2011-07-12 Thread Cal Leeming
On Tue, Jul 12, 2011 at 6:25 PM, Lukich wrote: > Hi. I have just started diving into Django and this question came up > - is there a way for me to examine all the attribute values of an > object? In Rails there's such a thing as debug statement which spits > out all the details about the object

Re: Inspecting objects

2011-07-12 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Jul 12, 2011 at 6:25 PM, Lukich wrote: > Hi. I have just started diving into Django and this question came up > - is there a way for me to examine all the attribute values of an > object? In Rails there's such a thing as debug statement which spits > out all the details about the object

Re: Inspecting objects

2011-07-12 Thread Venkatraman S
On Tue, Jul 12, 2011 at 10:55 PM, Lukich wrote: > Hi. I have just started diving into Django and this question came up > - is there a way for me to examine all the attribute values of an > object? In Rails there's such a thing as debug statement which spits > out all the details about the objec