How I see the SQL generated in the system in development?

2008-01-23 Thread Claudio Escudero
Hi,

How I see the SQL generated in the system in development?
Its appears on the console?

Thank,
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How I see the SQL generated in the system in development?

2008-01-23 Thread Claudio Escudero
Perfect,
Thank you

On Jan 23, 2008 5:03 PM, James Bennett <[EMAIL PROTECTED]> wrote:

>
> On Jan 23, 2008 9:17 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote:
> > How I see the SQL generated in the system in development?
> >  Its appears on the console?
>
>
> http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw-sql-queries-django-is-running
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



exists created_at or updated_at ?

2008-01-27 Thread Claudio Escudero
Anyone know if there is something like created_at or updated_at of Ruby on
Rails.
These fields are filled automatically when saving and editing?
The date of saving and editing

Thanks,
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: exists created_at or updated_at ?

2008-01-27 Thread Claudio Escudero
thanks

On Jan 27, 2008 6:40 PM, James Bennett <[EMAIL PROTECTED]> wrote:

>
> On Jan 27, 2008 10:54 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote:
> > Anyone know if there is something like created_at or updated_at of Ruby
> on
> > Rails.
> >  These fields are filled automatically when saving and editing?
>
> For any DateField or DateTimeField, you can tell Django to
> automatically update it on creation or on every save. Consult the
> model documentation.
>
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Invalid block tag: 'current_time'

2008-04-04 Thread Claudio Escudero
Hi,
I am having a problem creating tag, I do not know what I am forgetting

You are showing that error here:
TemplateSyntaxError at /home/
Invalid block tag: 'current_time'

somebody have any idea?
=/

I have the files
##
 Template (teste.html):
{% current_time "%Y-%m-%d %I:%M %p" %}

 I created a model myapp ( myproject/myapp )
 view.py
from django.shortcuts import render_to_response

def home(request):
return render_to_response('teste.html')

 I create directory and file
(myproject/myapp/templatetags/current_time.py)
import datetime
from django.core import template
from django.core.template import Context, loader

register = template.Library()

def do_current_time(parser, token):
try:
# split_contents() knows not to split quoted strings.
tag_name, format_string = token.split_contents()
except ValueError:
msg = '%r tag requires a single argument' % token.contents[0]
raise template.TemplateSyntaxError(msg)
return CurrentTimeNode(format_string[1:-1])

class CurrentTimeNode(template.Node):

def __init__(self, format_string):
self.format_string = format_string

def render(self, context):
now = datetime.datetime.now()
return now.strftime(self.format_string)

register.tag('current_time', do_current_time)
#

Only that.

=/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Invalid block tag: 'current_time'

2008-04-04 Thread Claudio Escudero
Hmmm, I understand
Put the {% load current_time%} in the template, but I do not know why, is
looking in the wrong place.
"django.templatetags.current_time,"

The right would be:
"myproject.myapp.templatetags.current_time"

showing that error here:
TemplateSyntaxError at /myapp/
'current_time' is not a valid tag library: Could not load template library
from django.templatetags.current_time, No module named current_time

somebody have any idea?
=/

On Fri, Apr 4, 2008 at 12:20 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On Fri, Apr 4, 2008 at 11:14 AM, Claudio Escudero <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> > I am having a problem creating tag, I do not know what I am forgetting
> >
> > You are showing that error here:
> > TemplateSyntaxError at /home/
> > Invalid block tag: 'current_time'
> >
> > somebody have any idea?
> > =/
> >
>
> I do not see in your template where you {% load current_time %} before
> trying to use the tag it registers.  See:
>
>
> http://www.djangoproject.com/documentation/templates/#custom-tag-and-filter-libraries
>
> Karen
>
>
> > I have the files
> > ##
> >  Template (teste.html):
> > {% current_time "%Y-%m-%d %I:%M %p" %}
> >
> >  I created a model myapp ( myproject/myapp )
> >  view.py
> > from django.shortcuts import render_to_response
> >
> > def home(request):
> > return render_to_response('teste.html')
> >
> >  I create directory and file
> > (myproject/myapp/templatetags/current_time.py)
> > import datetime
> > from django.core import template
> > from django.core.template import Context, loader
> >
> > register = template.Library()
> >
> > def do_current_time(parser, token):
> > try:
> > # split_contents() knows not to split quoted strings.
> > tag_name, format_string = token.split_contents()
> > except ValueError:
> > msg = '%r tag requires a single argument' % token.contents[0]
> > raise template.TemplateSyntaxError(msg)
> > return CurrentTimeNode(format_string[1:-1])
> >
> > class CurrentTimeNode(template.Node):
> >
> > def __init__(self, format_string):
> > self.format_string = format_string
> >
> > def render(self, context):
> > now = datetime.datetime.now()
> > return now.strftime(self.format_string)
> >
> > register.tag('current_time', do_current_time)
> > #
> >
> > Only that.
> >
> > =/
> >
> >
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Invalid block tag: 'current_time'

2008-04-04 Thread Claudio Escudero
Yes

TEMPLATE_DIRS = (
'home/escudero/projects_django/myproject/myapp/templatetags'
)


I have to change something in the TEMPLATE_LOADERS ?



On Fri, Apr 4, 2008 at 1:21 PM, Evert Rol <[EMAIL PROTECTED]> wrote:

>
> > Hmmm, I understand
> > Put the {% load current_time%} in the template, but I do not know
> > why, is looking in the wrong place.
> > "django.templatetags.current_time,"
> >
> > The right would be:
> > "myproject.myapp.templatetags.current_time"
> >
> > showing that error here:
> > TemplateSyntaxError at /myapp/
> > 'current_time' is not a valid tag library: Could not load template
> > library from django.templatetags.current_time, No module named
> > current_time
> >
> > somebody have any idea?
>
> Did you also set the TEMPLATE_DIRS correctly?
>
> > Hi,
> > I am having a problem creating tag, I do not know what I am forgetting
> >
> > You are showing that error here:
> > TemplateSyntaxError at /home/
> > Invalid block tag: 'current_time'
> >
> > somebody have any idea?
> > =/
> >
> > I do not see in your template where you {% load current_time %}
> > before trying to use the tag it registers.  See:
> >
> >
> http://www.djangoproject.com/documentation/templates/#custom-tag-and-filter-libraries
> >
> > Karen
> >
> >
> > I have the files
> > ##
> >  Template (teste.html):
> > {% current_time "%Y-%m-%d %I:%M %p" %}
> >
> >  I created a model myapp ( myproject/myapp )
> >  view.py
> > from django.shortcuts import render_to_response
> >
> > def home(request):
> > return render_to_response('teste.html')
> >
> >  I create directory and file (myproject/myapp/templatetags/
> > current_time.py)
> > import datetime
> > from django.core import template
> > from django.core.template import Context, loader
> >
> > register = template.Library()
> >
> > def do_current_time(parser, token):
> > try:
> > # split_contents() knows not to split quoted strings.
> > tag_name, format_string = token.split_contents()
> > except ValueError:
> > msg = '%r tag requires a single argument' % token.contents[0]
> > raise template.TemplateSyntaxError(msg)
> > return CurrentTimeNode(format_string[1:-1])
> >
> > class CurrentTimeNode(template.Node):
> >
> > def __init__(self, format_string):
> > self.format_string = format_string
> >
> > def render(self, context):
> > now = datetime.datetime.now()
> > return now.strftime(self.format_string)
> >
> > register.tag('current_time', do_current_time)
> > #
> >
> > Only that.
> >
> > =/
> >
>
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Invalid block tag: 'current_time'

2008-04-04 Thread Claudio Escudero
On Fri, Apr 4, 2008 at 1:23 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On Fri, Apr 4, 2008 at 12:07 PM, Claudio Escudero <[EMAIL PROTECTED]>
> wrote:
>
> > Hmmm, I understand
> > Put the {% load current_time%} in the template, but I do not know why,
> > is looking in the wrong place.
> > "django.templatetags.current_time,"
> >
> > The right would be:
> > "myproject.myapp.templatetags.current_time"
> >
>
> This is a quirk of the way Django automatically looks in your app's
> templatetags directory.
>
=/

>
>
> > showing that error here:
> > TemplateSyntaxError at /myapp/
> > 'current_time' is not a valid tag library: Could not load template
> > library from django.templatetags.current_time, No module named current_time
> >
> > somebody have any idea?
> > =/
> >
> >
> Do you have an __init__.py file in your templatetags directory?
>
yes

>
>
> Karen
>
>
> >
> > On Fri, Apr 4, 2008 at 12:20 PM, Karen Tracey <[EMAIL PROTECTED]>
> > wrote:
> >
> > > On Fri, Apr 4, 2008 at 11:14 AM, Claudio Escudero <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > Hi,
> > > > I am having a problem creating tag, I do not know what I am
> > > > forgetting
> > > >
> > > > You are showing that error here:
> > > > TemplateSyntaxError at /home/
> > > > Invalid block tag: 'current_time'
> > > >
> > > > somebody have any idea?
> > > > =/
> > > >
> > >
> > > I do not see in your template where you {% load current_time %} before
> > > trying to use the tag it registers.  See:
> > >
> > >
> > > http://www.djangoproject.com/documentation/templates/#custom-tag-and-filter-libraries
> > >
> > > Karen
> > >
> > >
> > > > I have the files
> > > > ##
> > > >  Template (teste.html):
> > > > {% current_time "%Y-%m-%d %I:%M %p" %}
> > > >
> > > >  I created a model myapp ( myproject/myapp )
> > > >  view.py
> > > > from django.shortcuts import render_to_response
> > > >
> > > > def home(request):
> > > > return render_to_response('teste.html')
> > > >
> > > >  I create directory and file
> > > > (myproject/myapp/templatetags/current_time.py)
> > > > import datetime
> > > > from django.core import template
> > > > from django.core.template import Context, loader
> > > >
> > > > register = template.Library()
> > > >
> > > > def do_current_time(parser, token):
> > > > try:
> > > > # split_contents() knows not to split quoted strings.
> > > > tag_name, format_string = token.split_contents()
> > > > except ValueError:
> > > > msg = '%r tag requires a single argument' %
> > > > token.contents[0]
> > > > raise template.TemplateSyntaxError(msg)
> > > > return CurrentTimeNode(format_string[1:-1])
> > > >
> > > > class CurrentTimeNode(template.Node):
> > > >
> > > > def __init__(self, format_string):
> > > > self.format_string = format_string
> > > >
> > > > def render(self, context):
> > > > now = datetime.datetime.now()
> > > > return now.strftime(self.format_string)
> > > >
> > > > register.tag('current_time', do_current_time)
> > > > #
> > > >
> > > > Only that.
> > > >
> > > > =/
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> > --
> > Claudio Escudero
> >
> >
> >
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Invalid block tag: 'current_time'

2008-04-04 Thread Claudio Escudero
It worked.
=)

I removed ".core"

And fix the unicode thus:

 Def __init__ (self, format_string):
 Self.format_string = str (format_string)

Thanks,
Claudio Escudero
=)


On Fri, Apr 4, 2008 at 2:12 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On Fri, Apr 4, 2008 at 12:35 PM, Claudio Escudero <[EMAIL PROTECTED]>
> wrote:
>
> >
> >
> > On Fri, Apr 4, 2008 at 1:23 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:
> >
> > > Do you have an __init__.py file in your templatetags directory?
> > >
> > yes
> >
> > >
> OK, then current_time.py should be found for loading but if it is still
> failing there must be errors in the code.  You need to look carefully at the
> whole error message to see where the problems were encountered.  I tried
> your file and ran into a few problems, noted below.
>
>
> > [snipped extra stuff]
> > >
> > > >
> > > > > > I have the files
> > > > > >
> > > > > > ##
> > > > > >  Template (teste.html):
> > > > > > {% current_time "%Y-%m-%d %I:%M %p" %}
> > > > > >
> > > > > >  I created a model myapp ( myproject/myapp )
> > > > > >  view.py
> > > > > > from django.shortcuts import render_to_response
> > > > > >
> > > > > > def home(request):
> > > > > > return render_to_response('teste.html')
> > > > > >
> > > > > >  I create directory and file
> > > > > > (myproject/myapp/templatetags/current_time.py)
> > > > > > import datetime
> > > > > > from django.core import template
> > > > > > from django.core.template import Context, loader
> > > > > >
> > > > >
> There should not be any '.core' in these two lines.  Fix them then the
> module will load, but you might hit an error below.
>
>
> > > > > > register = template.Library()
> > > > > >
> > > > > > def do_current_time(parser, token):
> > > > > > try:
> > > > > > # split_contents() knows not to split quoted strings.
> > > > > > tag_name, format_string = token.split_contents()
> > > > > > except ValueError:
> > > > > > msg = '%r tag requires a single argument' %
> > > > > > token.contents[0]
> > > > > > raise template.TemplateSyntaxError(msg)
> > > > > > return CurrentTimeNode(format_string[1:-1])
> > > > > >
> > > > > > class CurrentTimeNode(template.Node):
> > > > > >
> > > > > > def __init__(self, format_string):
> > > > > > self.format_string = format_string
> > > > > >
> > > > > > def render(self, context):
> > > > > > now = datetime.datetime.now()
> > > > > > return now.strftime(self.format_string)
> > > > > >
> > > > >
> The argument to strftime will need to be cast to a string if you're
> running a recent (unicode-enabled) Django.
>
> Karen
>
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



middleware that works with Ajax

2008-04-07 Thread Claudio Escudero
Hi,

Someone knows there is any middleware that works with Ajax, similar to RJS
of Ruby on Rails?

Tranks
Claudio

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



middleware that works with Ajax

2008-04-07 Thread Claudio Escudero
Hi,

Someone knows there is any middleware that works with Ajax?

Tranks,
Claudio

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: files xls

2008-04-09 Thread Claudio Escudero
Thanks,

I liked it.
=)

I did that tips for using pyExcelerator with the django
Http://www.developer.com/lang/other/article.php/3727616

On Wed, Apr 9, 2008 at 2:05 PM, Alex Ezell <[EMAIL PROTECTED]> wrote:

>
> On Wed, Apr 9, 2008 at 12:02 PM, Claudio Escudero <[EMAIL PROTECTED]>
> wrote:
>
> > Anyone knows there is a script to do with manipulation files xls
> (Excel)?
>
> Hi Claudio,
> This is not Django specific, but there is a python module called
> pyExcelerator, that while old, seems to work for me.
>
> http://sourceforge.net/projects/pyexcelerator
>
> /alex
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



files xls

2008-04-09 Thread Claudio Escudero
Hi,

Anyone knows there is a script to do with manipulation files xls (Excel)?

Thanks,
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Tag

2008-04-12 Thread Claudio Escudero
Hi,

Please, is there any way to put tag inside tag?
For example:

{% formajax {"action": {% url inn %} } %}

Displays this error:
too many values to unpack

Thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tag

2008-04-13 Thread Claudio Escudero
Hi,

What is block-like tag?
=/

Thanks,
Claudio

On Sat, Apr 12, 2008 at 10:26 PM, Malcolm Tredinnick <
[EMAIL PROTECTED]> wrote:

>
>
> On Sat, 2008-04-12 at 18:45 -0300, Claudio Escudero wrote:
> > Hi,
> >
> > Please, is there any way to put tag inside tag?
>
> No, this isn't possible. Use a block-like tag (something with a start
> tag and an end tag) if you want to do something like this.
>
> Regards,
> Malcolm
>
> --
> The cost of feathers has risen; even down is up!
> http://www.pointy-stick.com/blog/
>
>
> >
>


-- 
Claudio Escudero

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---