dir not working in manage.py runserver

6 views
Skip to first unread message

serek

unread,
Mar 27, 2010, 7:13:41 AM3/27/10
to Django users
Hi

When I run manage.py shell and use this code:

>>> from xxxx.page.models import *
>>> p = Page()
>>> dir(p)

it is work well, but when in views.py I use the same then is no
output? Why? I need something similat to php var_dump or pront_r (to
source page or console). What I do wrong?

Dennis Kaarsemaker

unread,
Mar 27, 2010, 8:07:49 AM3/27/10
to django...@googlegroups.com

You forget "print".

def view(...):
p = Page()
print dir(p)

The python interactive shell automatically prints the result of a
statement if it is not None and not assigned to a variable. Python does
not do that normally.
--
Dennis K.

The universe tends towards maximum irony. Don't push it.

tayfur yilmaz

unread,
Mar 27, 2010, 8:21:11 AM3/27/10
to django...@googlegroups.com
absolutely

2010/3/27 Dennis Kaarsemaker <den...@kaarsemaker.net>

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


Reply all
Reply to author
Forward
0 new messages