Re: print_r() in Django & SQL debug output

2009-05-02 Thread Dan Mallinger
, not >>         simply a Context object. >> >>         See this documentation (esp. the "note" callout): >>         http://docs.djangoproject.com/en/dev/ref/templates/api/#id1 >> >> Thanx.. You're right, I forgot to add this as the third parameter : >> c

Re: print_r() in Django & SQL debug output

2009-05-02 Thread Malcolm Tredinnick
e this documentation (esp. the "note" callout): > http://docs.djangoproject.com/en/dev/ref/templates/api/#id1 > > Thanx.. You're right, I forgot to add this as the third parameter : > context_instance=RequestContext(request) > > And, how about my fi

Re: print_r() in Django & SQL debug output

2009-05-02 Thread Okto Silaban
context_instance=RequestContext(request) And, how about my first question ? 1. What Django template tags can I use to replace print_r() / var_dump() in PHP? regards, okto.silaban.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: print_r() in Django & SQL debug output

2009-05-02 Thread Malcolm Tredinnick
On Sun, 2009-05-03 at 07:47 +0700, Okto Silaban wrote: > > > On Sun, May 3, 2009 at 7:04 AM, George Song wrote: > > > Django has extensive documentation. It's advisable that you > look it up > first before asking: > > >

Re: print_r() in Django & SQL debug output

2009-05-02 Thread Okto Silaban
On Sun, May 3, 2009 at 7:04 AM, George Song wrote: Django has extensive documentation. It's advisable that you look it up > first before asking: > > < > http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-debug > > Default : DEBUG = True TEMPLATE_DEBUG = DEBUG

Re: print_r() in Django & SQL debug output

2009-05-02 Thread George Song
On 5/2/2009 4:53 PM, Okto Silaban wrote: > Ok, I know this is not a PHP mailing list.. I just want to make the > question simpler. > > I'm coming from CakePHP background. > > 1. What Django template tags can I use to replace print_r() / var_dump() > in PHP? > 2

print_r() in Django & SQL debug output

2009-05-02 Thread Okto Silaban
Ok, I know this is not a PHP mailing list.. I just want to make the question simpler. I'm coming from CakePHP background. 1. What Django template tags can I use to replace print_r() / var_dump() in PHP? 2. How can I display SQL debug output? *in cakePHP I can use debug() function to sho

Re: Another print_r() to {% debug %} question...

2006-12-19 Thread radioflyer
Right on Aidas! That's what I needed to get me thinking straight. Thanks, Dan J. --~--~-~--~~~---~--~~ 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.

Re: Another print_r() to {% debug %} question...

2006-12-19 Thread Aidas Bendoraitis
You may pass a dictionary of album properties to the template like this: def album(request, album_id): a = Album.objects.get(id=album_id) return render_to_response('fc/album.html', {'album': a, 'album_dict': a.__dict__}) and then use pprint filter to read the properties in the temp

Re: Another print_r() to {% debug %} question...

2006-12-19 Thread Nathan R. Yergler
radioflyer wrote: > ...I'm new to Python and still thinking like a PHP user I'm afraid... > > I've found a number of posts about dumping debug info to a template, > but I'm still a little confused. Maybe I don't understand the nature > of the 'context' returned from my view. > > If I have this

Another print_r() to {% debug %} question...

2006-12-18 Thread radioflyer
...I'm new to Python and still thinking like a PHP user I'm afraid... I've found a number of posts about dumping debug info to a template, but I'm still a little confused. Maybe I don't understand the nature of the 'context' returned from my view. If I have this view: def album(request, album_i

Re: print_r

2006-10-16 Thread Terry
Don Arbow wrote: > The method is actually called pdb.set_trace(). Whoops! So it is. Sorry for the confusion. - Terry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: print_r

2006-10-16 Thread Don Arbow
On Oct 16, 2006, at 1:30 PM, Rob Hudson wrote: > > On Oct 16, 1:00 pm, "Terry" <[EMAIL PROTECTED]> wrote: >> Easiest way I've found to do it is to add the following as the first >> two lines of the view function that you want to debug: >> >> import pdb >> pdb.run_trace() >> >> Then, when y

Re: print_r

2006-10-16 Thread Terry
Rob Hudson wrote: > I was trying to see what this did but I get an error that there is no > run_trace() method in pdb. In looking at pdb from the Python shell, I > see this is true. At least for my Python version (2.3.5). Did you > mean another method? If so, could you explain more? No, that

Re: print_r

2006-10-16 Thread Steven Armstrong
On 10/16/06 21:11, Rob Hudson wrote: > On Oct 16, 11:17 am, Steven Armstrong <[EMAIL PROTECTED]> wrote: >> A djangofied version of this [1] would be cool. >> >> [1]http://pythonpaste.org/screencasts/evalerror-screencast.html > > I agree. That would be very useful. One could argue that it should

Re: print_r

2006-10-16 Thread Rob Hudson
On Oct 16, 1:00 pm, "Terry" <[EMAIL PROTECTED]> wrote: > Easiest way I've found to do it is to add the following as the first > two lines of the view function that you want to debug: > > import pdb > pdb.run_trace() > > Then, when you attempt to load the view, you will get the (pdb) prompt

Re: print_r

2006-10-16 Thread Terry
code enquest wrote: > in PhP i used to print_r(array) to see what if got in my array that I > want to bring on the screen. Smarty even had a popup screen to show this. > > How can I see in Django what I got in the view? So that working in the > template goes a tat faster? What

Re: print_r

2006-10-16 Thread Rob Hudson
On Oct 16, 11:17 am, Steven Armstrong <[EMAIL PROTECTED]> wrote: > A djangofied version of this [1] would be cool. > > [1]http://pythonpaste.org/screencasts/evalerror-screencast.html I agree. That would be very useful. One could argue that it should only be accessible when running under WSGI.

Re: print_r

2006-10-16 Thread Steven Armstrong
On 10/16/06 17:43, Rob Hudson wrote: > [EMAIL PROTECTED] wrote: >> I quite often plug in a nonsense command e.g. "fudge" just to raise the >> debug page, maybe with a few > > I do the same. It would be awesome if there were a "debugger" app > (contrib app anyone?) that we could load in the templ

Re: print_r

2006-10-16 Thread Rob Hudson
[EMAIL PROTECTED] wrote: > I quite often plug in a nonsense command e.g. "fudge" just to raise the > debug page, maybe with a few I do the same. It would be awesome if there were a "debugger" app (contrib app anyone?) that we could load in the template: {{ debugger }} That would show a unobtru

Re: print_r

2006-10-16 Thread Dirk Eschler
Am Sonntag, 15. Oktober 2006 00:01 schrieb [EMAIL PROTECTED]: > I quite often plug in a nonsense command e.g. "fudge" just to raise the > debug page, maybe with a few > > x = dir(some_var) > > .. to see what's in them. Once the Django debug page is up, you can > have a really good poke around with

Re: print_r

2006-10-14 Thread [EMAIL PROTECTED]
I quite often plug in a nonsense command e.g. "fudge" just to raise the debug page, maybe with a few x = dir(some_var) .. to see what's in them. Once the Django debug page is up, you can have a really good poke around with things. The other alternative is the shell, which is great for working o

Re: print_r

2006-10-14 Thread Steven Armstrong
On 10/14/06 20:11, code enquest wrote: > Steven Armstrong schreef: >> On 10/14/06 19:46, code enquest wrote: >> >>> in PhP i used to print_r(array) to see what if got in my array that I >>> want to bring on the screen. Smarty even had a popup screen to sh

Re: print_r

2006-10-14 Thread code enquest
Steven Armstrong schreef: > On 10/14/06 19:46, code enquest wrote: > >> in PhP i used to print_r(array) to see what if got in my array that I >> want to bring on the screen. Smarty even had a popup screen to show this. >> >> How can I see in Django what I got i

Re: print_r

2006-10-14 Thread Bryan L. Fordham
code enquest wrote: >in PhP i used to print_r(array) to see what if got in my array that I >want to bring on the screen. Smarty even had a popup screen to show this. > >How can I see in Django what I got in the view? So that working in the >template goes a tat faster? What is the

Re: print_r

2006-10-14 Thread Steven Armstrong
On 10/14/06 19:46, code enquest wrote: > in PhP i used to print_r(array) to see what if got in my array that I > want to bring on the screen. Smarty even had a popup screen to show this. > > How can I see in Django what I got in the view? So that working in the > template go

print_r

2006-10-14 Thread code enquest
in PhP i used to print_r(array) to see what if got in my array that I want to bring on the screen. Smarty even had a popup screen to show this. How can I see in Django what I got in the view? So that working in the template goes a tat faster? What is the print_r($array) in the template or Django

print_r

2006-10-14 Thread code enquest
in PhP i used to print_r(array) to see what if got in my array that I want to bring on the screen. Smarty even had a popup screen to show this. How can I see in Django what I got in the view? So that working in the template goes a tat faster? What is the print_r($array) in the template or