Problems with template IFs and generic views

2006-11-05 Thread [EMAIL PROTECTED]

I'm using django.views.generic.list_detail.object_detail to show a
page. Beside text it has optional "leftmenu" field. What I want to do
is to show it in a html block if it exists (there is somethign in
"leftmenu"). The problem is that it shows always or never.

I have:
###
{% if object.leftmenu %}
{% block leftmenu %}


Menu Strony

{{ object.leftmenu|restructuredtext }}


{% endblock %}
{% endif %}

And it shows always.

When I change the IF to:

{% ifnotequal object.leftmenu|wordcount "0" %}

It won't show at all (object.leftmenu|wordcount  is > 0 for pages with
leftmenu that has some text)


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



To set default mutiple inline items

2006-11-05 Thread SNake!

Hi guys,

I am trying Django's auto admin and I encounter some problems.

The story is that I am working on a Product Category system and in a
class Product, one product has many attributes ( for example: size,
color, weight and so on) , So there is a one to many relationship. I
model it as following (the simplest one):

# models.py
class Product(models.Model):
name = models.CharField(maxlength=100)
class Admin:
pass

class Product_attribute(models.Model):
name = models.CharField(maxlength=100)
val   = models.CharField(maxlength=100)
product = models.ForeignKey(
Product,min_num_in_admin=5,
edit_inline=models.TABULAR,
num_extra_on_change=5
)
class Admin:
pass

So it is possible that I have some default attribue: for example, every
product have color and size, So I hope when I am adding a new Product,
the first two inline items' name value have been already set to 'color'
and 'size'.

Thanks in advance.


--~--~-~--~~~---~--~~
 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: Best way to extend admin change_form?

2006-11-05 Thread Mario Graziosi

Patrikk,

it worked as you told me. My template_dirs were a mess and that's the 
reason I didn't get it working on my first try.

Thanks.

patrickk wrote:
> not sure if I understand this right.
>
> when you use the approach I´ve mentioned, you get exactly this:
> 1. specific change_forms for whatever model you like
> 2. standard change_form for all the other models
>
> back to the template_loaders:
> first, django searches the "filesystem" for the change_form. if the  
> change_form isn´t there it uses the standard change_form in the app- 
> directory.
>
> btw: I´m on the django IRC channel for additional help.
>
> patrick
>
> Am 05.11.2006 um 18:02 schrieb Mario Graziosi:
>
>   
>> Thanks patrickk,
>>
>> but the point is that I wish to use the standard change_form most  
>> of the
>> time but, for some models I wish to use a tailored change_form. I  
>> can't
>> see how, even using the template_loaders you're telling about, I could
>> accomplish that.
>>
>> patrickk wrote:
>> 
>>> you don´t have to tell the admin engine at all if you use this
>>> template_loaders:
>>>  'django.template.loaders.filesystem.load_template_source',
>>>  'django.template.loaders.app_directories.load_template_source',
>>>
>>> just copy the change_form from the app_directory (django/contrib/
>>> admin/...) to your template_directory,
>>> e.g. to /templates/app_name/model_name/change_form.html
>>>
>>> patrick
>>>
>>> Am 05.11.2006 um 17:50 schrieb Mario Graziosi:
>>>
>>>
>>>   
 I wish to extend the standard admin "change_form": which is the
 best way
 to do it?

 The specific problem I need to solve is to find a workaround to a
 Django
 bug (Ticket #2522). I need to keep form header, footer and submit
 buttons and store my own stuff. I found this possible solution:
 1. create my own copy of "change_form.html"
 2. create a block for the piece of template I wish to extend/replace
 3. create a new form which inherits from the "change_form.html"

 However, how do I tell to the admin engine that, for a given  
 model, a
 form other than "change_form.html" should be used? I suspect the
 correct
 place to tell it is in urls.conf, but how should I change the line
 below
 to accomplish that?

 (r'^admin/', include('django.contrib.admin.urls')),






 
>>>   
>>>   
>> -- 
>> Mario Graziosi, mailto:[EMAIL PROTECTED]
>> FG&A srl (http://www.fgasoftware.com/)
>> [EMAIL PROTECTED]: The agile PBX (http://www.voiceatwork.eu/)
>> Tel: 02 9350-4780 interno 101, Fax: 02 9139-0172
>>
>>
>> 
>
>
> >
>
>   


-- 
Mario Graziosi, mailto:[EMAIL PROTECTED]
FG&A srl (http://www.fgasoftware.com/)
[EMAIL PROTECTED]: The agile PBX (http://www.voiceatwork.eu/)
Tel: 02 9350-4780 interno 101, Fax: 02 9139-0172


--~--~-~--~~~---~--~~
 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: Issues with FastCGI

2006-11-05 Thread [EMAIL PROTECTED]

Did you read this:
http://www.python.rk.edu.pl/w/p/django-pod-serwerem-nginx/ ? :)


--~--~-~--~~~---~--~~
 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: Best configuration for small VPS

2006-11-05 Thread [EMAIL PROTECTED]

I haven't tested under load at all, the site gets very little traffic,
about 4 unique visitors per day.


Here's some of the apache processes from ps aux


USER   PID %CPU %MEM   VSZ  RSS TTY  STAT START   TIME COMMAND
www-data 27197  0.0  3.3 10488 2012 ?S22:24   0:00
/usr/sbin/apache2 -k start -DSSL
www-data 27198  0.0 21.7 75128 13112 ?   S22:24   0:00
/usr/sbin/apache2 -k start -DSSL
www-data 27199  0.0 10.7 76280 6496 ?S22:24   0:00
/usr/sbin/apache2 -k start -DSSL
www-data 27200  0.0 21.7 75128 13112 ?   S22:24   0:00
/usr/sbin/apache2 -k start -DSSL
www-data 27202  0.0 10.7 76280 6496 ?S22:24   0:00
/usr/sbin/apache2 -k start -DSSL

There's about a total 58 of them. Quite a bit of that memory must be
shared. But then memory usage reports have always been a bit of mystery
to me. How the %Mem column can add up to about 937.3% means that there
must be some happy sharing going on...

Try :
ps aux | awk '{ tot += $4 } END {print tot}'
to get your super %mem usage :)


--~--~-~--~~~---~--~~
 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: Automatically starting the FastCGI server

2006-11-05 Thread Norbert Wojtowicz

I am also interested in how others have solved this. I hope I'm not 
hijacking the thread, but could we see your Debian approach to this problem?

Grigory Fateyev wrote:
> Hello orestis!
> On Fri, 03 Nov 2006 18:53:26 - you wrote:
>
>   
>> Hello,
>>
>> I'm new to linux administration, but I try to learn :)
>>
>> I have managed to make lighttpd and postgresql start automatically
>> upon reboot, now I need a way to make manage.py runfcgi to start
>> automatically.
>> 
> [...] 
>   
>> Has anyone made this work ? An init.d script would be nice too, as I'd
>> like to run the django fcgi server under a different user.
>> 
>
> What OS you are working on? If Debian, can help you...
>
>   


--~--~-~--~~~---~--~~
 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: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at

2006-11-05 Thread Andy

It doesn't seem to be working, or at least it hasn't yet come out that
way. I made another attempt where I essentially left out the {else} and
nothing at all rendered, so that filter doesn't seem to be catching it.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Issues with FastCGI

2006-11-05 Thread Jaroslaw Zabiello

I am using Django SVN rev.4021, Python 2.4.3, Nginx 0.4.12, I cannot
launch Django under FastCGI.

My django.fcgi file is:

#!/usr/bin/env python
import os, sys
sys.path += ['/home/app']
from flup.server.fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings'
WSGIServer(WSGIHandler()).run()

I am executing FastCGI server with spawn-fcgi (taken from Lighttpd)

spawn-fcgi  -a 127.0.0.1 -p 10001 -u nobody -f
/home/app/django_project/myapp/public/django.fcgi

I am using  Nginx (very fast HTTP server: http://nginx.net/) with
settings;

...
server {
  listen 81;
  server_name localhost;
  error_log /var/log/vservers/test-error.log debug;
  fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
  fastcgi_param  SERVER_SOFTWAREnginx;

  fastcgi_param  QUERY_STRING   $query_string;
  fastcgi_param  REQUEST_METHOD $request_method;
  fastcgi_param  CONTENT_TYPE   $content_type;
  fastcgi_param  CONTENT_LENGTH $content_length;

  fastcgi_param  SCRIPT_NAME$fastcgi_script_name;
  fastcgi_param  REQUEST_URI$request_uri;
  fastcgi_param  DOCUMENT_URI   $document_uri;
  fastcgi_param  DOCUMENT_ROOT  $document_root;
  fastcgi_param  SERVER_PROTOCOL$server_protocol;

  fastcgi_param  REMOTE_ADDR$remote_addr;
  fastcgi_param  REMOTE_PORT$remote_port;
  fastcgi_param  SERVER_ADDR$server_addr;
  fastcgi_param  SERVER_PORT$server_port;
  fastcgi_param  SERVER_NAME$server_name;
  location / {
root /home/app/django_project/myapp/public;
rewrite ^/(media|stylesheets|images|javascripts)(.*) /$1/$2 break;
rewrite ^/(.*)$ /django.fcgi/$1 break;
fastcgi_pass 127.0.0.1:10001;
fastcgi_index django.fcgi;
fastcgi_param SCRIPT_FILENAME
/home/app/django_project/myapp/public$fastcgi_script_name;
  }
}

First, I had to set settings.APPEND_SLASH=False to avoid errors from
flup.  But it did not help. Now I have exception:

  Exception Type:   TypeError
  Exception Value:  unpack non-sequence
  Exception Location:
/usr/lib/python2.4/site-packages/django/core/handlers/base.py in
get_response, line 65


It is interesting, that under Lighttpd it works. My settings are:

...
   url.rewrite-once = (
 "^/(media|stylesheets|images|javascripts).*" => "$0",
 "^/(.*)$" => "/django.fcgi/$1"
   )

  fastcgi.server = (
"/django.fcgi" => (
  (
"bin-path" => "/home/app/django/django_project/django.fcgi",
"socket" => "/var/run/lighttpd/django.sock",
"check-local" => "disable",
"min-procs" => 1,
"max-procs" => 1,
  )
),


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Generic Views

2006-11-05 Thread Keith Mallory
I wrote a blog using classic views (writing  functions for reach URLpattern). It works perfectly. However when I tried to convert it using the same database using generic views, it does not work.Then  I tried using the updated code from the following link
http://fallingbullets.com/blog/2006/aug/06/wordpress-clone-27-seconds-part-1-40/as well as RossP's updated blog.
I have cut and pasted the code. It is throwing up 404 error saying that there are no entrys. But I can see at 10 of them using my admin interface.In fact I followed the instructions all over again twice and still no avail.
I know I am doing something silly. But what can that be. Has anyone had similar experience? The code is ditto from fallingbullets article. Note, I have entrys in the database 2) The URLS are matching. I have my base.html
 and entry_archive.html and entry_detail.html at the right places.Is there anything which I need to do in settings.py to enable Generic Views. I did not see anything in Documentation.Keith MalloryThe Human Fly


--~--~-~--~~~---~--~~
 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: Re: Bugtracker sucks?

2006-11-05 Thread James Bennett

On 11/5/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
> One of the admins can white-list you so that you can post tickets.

I'm also working on some friendlier authentication stuff, so people
will be able to sign up for accounts and post tickets while logged in
(we've got Trac set to filter for spam only form non-logged-in users).

In the long term, we're looking at a couple of improvements and
plugins to Trac to help resolve this.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
 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: Bugtracker sucks?

2006-11-05 Thread Todd O'Bryan

It's a known issue that's being worked on. Unfortunately, the current
inconvenience is less inconvenient than all the tickets having lots of
spam attached to them.

One of the admins can white-list you so that you can post tickets.

Todd

On Mon, 2006-11-06 at 03:05 +, Jaroslaw Zabiello wrote:
> There are issues with bugtracker
> (http://code.djangoproject.com/newticket). I and few other people are
> not able to add new ticket, because it returns Internal Error "Akismet
> rejected spam"
> 


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Bugtracker sucks?

2006-11-05 Thread Jaroslaw Zabiello

There are issues with bugtracker
(http://code.djangoproject.com/newticket). I and few other people are
not able to add new ticket, because it returns Internal Error "Akismet
rejected spam"

-- 
Jaroslaw Zabiello
http://blog.zabiello.com


--~--~-~--~~~---~--~~
 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: I am really new, but I found a few problems using it, or am I wrong?

2006-11-05 Thread Peter Ma

you need the python with data module.

On 11/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Thanks James,
>
> I figured it out after a while, but it seems not to be a good idea to
> install development version. I did that and made a mess of my computer.
> I guess there is a version catch up for Django to do so that it will
> keep up with Python releases.
>
> I look forward to the next release of Django so that I donot need to
> strugle this much for it to be compatable with my Python 2.5.
>
> Thanks
> Libo
>
> On Nov 5, 2:28 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> > On 11/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > > In file "ez_setup.py", a configuration line should be
> > > DEFAULT_VERSION = "0.6c3"
> > > in stead of
> > > DEFAULT_VERSION = "0.6c1"The ez_setup.py and the corresponding things it 
> > > used have actually
> > been removed since the 0.95 release; having to constantly make minor
> > changes like the one you point out, and the requirements it imposed on
> > the installation process, just weren't worth it. Django now just uses
> > the standard Python distutils instead of setuptools.
> >
> > > Secondly, I was trying to connect it to the database, then I added a
> > > line of DATABASE_ENGINE = "sqlite3" to the settings.py file and
> > > configured the DATABASE_NAME as the directory. Then I got a traceback
> > > error when I was trying to execute "python manage.py syncdb", it saids
> > > that one file is trying to import an unexisting module in python 2.5.
> > > The module name is "pysqlite2", and it is not in python module 
> > > folder.This is mostly a Python 2.4 -> 2.5 compatibility issue; at the time
> > Django 0.95 was released, Python 2.5 had not been released, so Django
> > 0.95 relies on the old third-party SQLite module instead of the one
> > that comes with Python 2.5. The current Django trunk (which you can
> > get by following the instructions for installing the development
> > version) was updated shortly after the Python 2.5 release to include
> > some extra logic to check whether it's running under Python 2.5 (in
> > which case it uses Python 2.5's built-in SQLite module) or an earlier
> > version (in which case it will require the old third-party SQLite
> > module).
> >
> > --
> > "May the forces of evil become confused on the way to your house."
> >   -- George Carlin
>
>
> >
>


-- 
www.mawei.name
Petit
IM&mail:[EMAIL PROTECTED]
13585201588

--~--~-~--~~~---~--~~
 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: Automatically starting the FastCGI server

2006-11-05 Thread orestis

I'm using CentOS, it's like RedHat AFAIK...


--~--~-~--~~~---~--~~
 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: I am really new, but I found a few problems using it, or am I wrong?

2006-11-05 Thread [EMAIL PROTECTED]

Thanks James,

I figured it out after a while, but it seems not to be a good idea to
install development version. I did that and made a mess of my computer.
I guess there is a version catch up for Django to do so that it will
keep up with Python releases.

I look forward to the next release of Django so that I donot need to
strugle this much for it to be compatable with my Python 2.5.

Thanks
Libo

On Nov 5, 2:28 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 11/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > In file "ez_setup.py", a configuration line should be
> > DEFAULT_VERSION = "0.6c3"
> > in stead of
> > DEFAULT_VERSION = "0.6c1"The ez_setup.py and the corresponding things it 
> > used have actually
> been removed since the 0.95 release; having to constantly make minor
> changes like the one you point out, and the requirements it imposed on
> the installation process, just weren't worth it. Django now just uses
> the standard Python distutils instead of setuptools.
>
> > Secondly, I was trying to connect it to the database, then I added a
> > line of DATABASE_ENGINE = "sqlite3" to the settings.py file and
> > configured the DATABASE_NAME as the directory. Then I got a traceback
> > error when I was trying to execute "python manage.py syncdb", it saids
> > that one file is trying to import an unexisting module in python 2.5.
> > The module name is "pysqlite2", and it is not in python module folder.This 
> > is mostly a Python 2.4 -> 2.5 compatibility issue; at the time
> Django 0.95 was released, Python 2.5 had not been released, so Django
> 0.95 relies on the old third-party SQLite module instead of the one
> that comes with Python 2.5. The current Django trunk (which you can
> get by following the instructions for installing the development
> version) was updated shortly after the Python 2.5 release to include
> some extra logic to check whether it's running under Python 2.5 (in
> which case it uses Python 2.5's built-in SQLite module) or an earlier
> version (in which case it will require the old third-party SQLite
> module).
>
> --
> "May the forces of evil become confused on the way to your house."
>   -- George Carlin


--~--~-~--~~~---~--~~
 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: A question about for loop in templates

2006-11-05 Thread Ivan Sagalaev

Vizcayno wrote:
> but the only idea
> that this recommended solution represents a double processing
> (accommodate the list) and double use of memory with 'table' restrained
> me to continue and send this message

'Premature optimization is the root of all evil' :-). In this case, if 
only your data is not sized in gigabytes, I am pretty sure that cost of 
this processing would be absolutely invisible both in speed and memory.

--~--~-~--~~~---~--~~
 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: Django or TurboGears for a new survery application?

2006-11-05 Thread Matt Culbreth


Adrian Holovaty wrote:
>
> My suggestion would be to build a quick application with both
> frameworks and use the one that feels more natural to you. Both
> frameworks will let you get the job done, but they have different
> philosophies. TurboGears' philosophy is closer to that of Linux,
> valuing the interoperability of obscure parts at almost a
> religious/political level, with predictable results in terms of
> usability and elegance. Django's philosophy is closer to that of a
> Mac, which values usability, productivity and a great user experience
> while allowing for a fair amount of flexibility under the hood.

Great reply, thanks!  That is a good analogy for me actually, as I'm a
Mac user.  I get your point here.

The suggestion of doing a quick application is a good one.  I'll let
you know how it goes.

Thanks,

Matt


--~--~-~--~~~---~--~~
 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: A question about for loop in templates

2006-11-05 Thread Vizcayno

Ivan:
Many thanks for your attention and help. My intention in this occasion
was to gain speed at the moment to show data at the web page. I thought
to do something similar to what you kindly proposed, but the only idea
that this recommended solution represents a double processing
(accommodate the list) and double use of memory with 'table' restrained
me to continue and send this message, but as you say, it is better to
follow the good practices.
Very best regards.


--~--~-~--~~~---~--~~
 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: Django or TurboGears for a new survery application?

2006-11-05 Thread iain duncan

On Sun, 2006-05-11 at 14:27 -0600, Adrian Holovaty wrote:
> On 11/5/06, Matt Culbreth <[EMAIL PROTECTED]> wrote:
> > So, based on this, my initial leaning had been to go to TurboGears.  My
> > thoughts were that the application is not interested in content
> > management or display, and that I'd like to use a bit of AJAX goodies
> > here and there.
> >
> > Any different take on this?  Is Django a fit here and I'm not seeing
> > it?

I like both approaches ( Gears and Django's ) but for what you describe
I would go with Django. If you need a simple admin interface, then
Django shines in that regard, and further Django uses a Poll as an
example in the tutorials so you'd probably have a really easy time
getting going!

Iain



--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Django Theme for Apple Keynote

2006-11-05 Thread Mike Cantelon

For anyone giving presentations about Django who wants their
presentation "Django-branded", feel free to use an Apple Keynote
template I created for the purpose:

http://mikecantelon.com/?q=node/12

Cheers,

Mike Cantelon
Vancouver Open Business
http://vanopen.biz


--~--~-~--~~~---~--~~
 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: Installation failed on Ubuntu 5.10

2006-11-05 Thread [EMAIL PROTECTED]

On Debian Sarge and I'm assuming Ubuntu as well, u need to install
python2.4-dev before setup.py will work

try:

sudo apt-get install python-dev

and then try the install again. Follow Jeremy Dunck's advice on putting
Django in a temp dir, not in python2.4 before running setup.py


--~--~-~--~~~---~--~~
 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: Django or TurboGears for a new survery application?

2006-11-05 Thread Gábor Farkas

Matt Culbreth wrote:
> Hello Friends,
> 
> I'm beginning a new project for a client and I'm going to use either
> Django or TurboGears.  I'd like to get some feedback from this group on
> the direction I should take.
> 
>
 > 
 >
> So, based on this, my initial leaning had been to go to TurboGears.  My
> thoughts were that the application is not interested in content
> management or display, and that I'd like to use a bit of AJAX goodies
> here and there.

hi,

could you tell us how is it easier to do AJAX in turbogears than it's in 
django?

gabor

--~--~-~--~~~---~--~~
 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: Django or TurboGears for a new survery application?

2006-11-05 Thread Adrian Holovaty

On 11/5/06, Matt Culbreth <[EMAIL PROTECTED]> wrote:
> So, based on this, my initial leaning had been to go to TurboGears.  My
> thoughts were that the application is not interested in content
> management or display, and that I'd like to use a bit of AJAX goodies
> here and there.
>
> Any different take on this?  Is Django a fit here and I'm not seeing
> it?

Hey Matt,

Django would definitely be a great fit for that. I'm not sure how you
got the impression TurboGears would be better, but I suspect your
impression has been colored by marketing rather than by cold, hard
facts.

Regarding the implication in your posting that Django is only suited
for content management, I'd encourage you to check out this FAQ
answer:

http://www.djangoproject.com/documentation/faq/#is-django-a-content-management-system-cms

My suggestion would be to build a quick application with both
frameworks and use the one that feels more natural to you. Both
frameworks will let you get the job done, but they have different
philosophies. TurboGears' philosophy is closer to that of Linux,
valuing the interoperability of obscure parts at almost a
religious/political level, with predictable results in terms of
usability and elegance. Django's philosophy is closer to that of a
Mac, which values usability, productivity and a great user experience
while allowing for a fair amount of flexibility under the hood.

At the end of the day, it's a personal decision. Good luck!

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Django or TurboGears for a new survery application?

2006-11-05 Thread Matt Culbreth

Hello Friends,

I'm beginning a new project for a client and I'm going to use either
Django or TurboGears.  I'd like to get some feedback from this group on
the direction I should take.

The facts:
1.  The application is basically for a user to respond to surveys.
2.  The survey questions are fixed and follow the standard 5 point
response types with radio buttons (strongly agree, agree, mix,
disagree, strongly disagree).
3.  There are a fixed number of survey pages.  The user fills out a
survey and then is asked to select from a pre-defined list of possible
problems and their solutions.  The application shows the pre-defined
list, which is filtered based on some of their answers to the survey
questions.
4.  There needs to be a very simple Admin interface to essentially
create a new survey instance, invite users (by emails), and then
monitor the progress of the survey (who has responded, etc.).
5.  There will be 5-6 reports based on the surveys.  These reports are
aggregate responses by manager, organization unit, etc.  Nothing
overall difficult.

So, based on this, my initial leaning had been to go to TurboGears.  My
thoughts were that the application is not interested in content
management or display, and that I'd like to use a bit of AJAX goodies
here and there.

Any different take on this?  Is Django a fit here and I'm not seeing
it?

Thanks for any feedback,

Matt


--~--~-~--~~~---~--~~
 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: Template inclusion tags, include once

2006-11-05 Thread SmileyChris

It's possible:

Set a variable in the context. Only do whatever the template tag does
if the variable has not been set.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Problems installing

2006-11-05 Thread skipmartin

Tearing my hair out here...

Getting a "400 - Bad Request"

I've done everything I can find in any tutorial... please help! Trying
to run on Apache 1.3 with FastCGI


In my httpd.conf



FastCGIExternalServer /home/user/public_html/mysite.fcgi -host
127.0.0.1:3033




ServerAlias mywebsite.com
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/myusername/public_html
BytesLog domlogs/mywebsite.com-bytes_log
ServerName www.mywebsite.com

User myusername
Group myusername
CustomLog /usr/local/apache/domlogs/mywebsite.com combined
ScriptAlias /cgi-bin/ /home/myusername/public_html/cgi-bin/

Alias /media
./usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/admin/media

RewriteEngine On
RewriteRule ^/(media.*)$ /$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ mysite.fcgi/$1 [QSA,L]




I have my project set up under /home/myusername/content
I started the fastcgi server with  ./manage.py fastcgi method=threaded
host=127.0.0.1 port=3033

I get no errors when starting the server, and I can see it running in
my process list.


Any ideas??

Thanks!
Andy


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Template inclusion tags, include once

2006-11-05 Thread Ed

Is it possible to create a constraint that only allows a template tag
to be used only once?

This would be useful for a template inclusion tag that includes inline
javascript.

Thanks,
Ed.


--~--~-~--~~~---~--~~
 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: Best way to extend admin change_form?

2006-11-05 Thread patrickk

not sure if I understand this right.

when you use the approach I´ve mentioned, you get exactly this:
1. specific change_forms for whatever model you like
2. standard change_form for all the other models

back to the template_loaders:
first, django searches the "filesystem" for the change_form. if the  
change_form isn´t there it uses the standard change_form in the app- 
directory.

btw: I´m on the django IRC channel for additional help.

patrick

Am 05.11.2006 um 18:02 schrieb Mario Graziosi:

>
> Thanks patrickk,
>
> but the point is that I wish to use the standard change_form most  
> of the
> time but, for some models I wish to use a tailored change_form. I  
> can't
> see how, even using the template_loaders you're telling about, I could
> accomplish that.
>
> patrickk wrote:
>> you don´t have to tell the admin engine at all if you use this
>> template_loaders:
>>  'django.template.loaders.filesystem.load_template_source',
>>  'django.template.loaders.app_directories.load_template_source',
>>
>> just copy the change_form from the app_directory (django/contrib/
>> admin/...) to your template_directory,
>> e.g. to /templates/app_name/model_name/change_form.html
>>
>> patrick
>>
>> Am 05.11.2006 um 17:50 schrieb Mario Graziosi:
>>
>>
>>> I wish to extend the standard admin "change_form": which is the
>>> best way
>>> to do it?
>>>
>>> The specific problem I need to solve is to find a workaround to a
>>> Django
>>> bug (Ticket #2522). I need to keep form header, footer and submit
>>> buttons and store my own stuff. I found this possible solution:
>>> 1. create my own copy of "change_form.html"
>>> 2. create a block for the piece of template I wish to extend/replace
>>> 3. create a new form which inherits from the "change_form.html"
>>>
>>> However, how do I tell to the admin engine that, for a given  
>>> model, a
>>> form other than "change_form.html" should be used? I suspect the
>>> correct
>>> place to tell it is in urls.conf, but how should I change the line
>>> below
>>> to accomplish that?
>>>
>>> (r'^admin/', include('django.contrib.admin.urls')),
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>>
>>
>>
>
>
> -- 
> Mario Graziosi, mailto:[EMAIL PROTECTED]
> FG&A srl (http://www.fgasoftware.com/)
> [EMAIL PROTECTED]: The agile PBX (http://www.voiceatwork.eu/)
> Tel: 02 9350-4780 interno 101, Fax: 02 9139-0172
>
>
> >


--~--~-~--~~~---~--~~
 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: Best way to extend admin change_form?

2006-11-05 Thread Mario Graziosi

Thanks patrickk,

but the point is that I wish to use the standard change_form most of the 
time but, for some models I wish to use a tailored change_form. I can't 
see how, even using the template_loaders you're telling about, I could 
accomplish that.

patrickk wrote:
> you don´t have to tell the admin engine at all if you use this  
> template_loaders:
>  'django.template.loaders.filesystem.load_template_source',
>  'django.template.loaders.app_directories.load_template_source',
>
> just copy the change_form from the app_directory (django/contrib/ 
> admin/...) to your template_directory,
> e.g. to /templates/app_name/model_name/change_form.html
>
> patrick
>
> Am 05.11.2006 um 17:50 schrieb Mario Graziosi:
>
>   
>> I wish to extend the standard admin "change_form": which is the  
>> best way
>> to do it?
>>
>> The specific problem I need to solve is to find a workaround to a  
>> Django
>> bug (Ticket #2522). I need to keep form header, footer and submit
>> buttons and store my own stuff. I found this possible solution:
>> 1. create my own copy of "change_form.html"
>> 2. create a block for the piece of template I wish to extend/replace
>> 3. create a new form which inherits from the "change_form.html"
>>
>> However, how do I tell to the admin engine that, for a given model, a
>> form other than "change_form.html" should be used? I suspect the  
>> correct
>> place to tell it is in urls.conf, but how should I change the line  
>> below
>> to accomplish that?
>>
>> (r'^admin/', include('django.contrib.admin.urls')),
>>
>>
>>
>>
>>
>> 
>
>
> >
>
>   


-- 
Mario Graziosi, mailto:[EMAIL PROTECTED]
FG&A srl (http://www.fgasoftware.com/)
[EMAIL PROTECTED]: The agile PBX (http://www.voiceatwork.eu/)
Tel: 02 9350-4780 interno 101, Fax: 02 9139-0172


--~--~-~--~~~---~--~~
 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: Best way to extend admin change_form?

2006-11-05 Thread patrickk

you don´t have to tell the admin engine at all if you use this  
template_loaders:
 'django.template.loaders.filesystem.load_template_source',
 'django.template.loaders.app_directories.load_template_source',

just copy the change_form from the app_directory (django/contrib/ 
admin/...) to your template_directory,
e.g. to /templates/app_name/model_name/change_form.html

patrick

Am 05.11.2006 um 17:50 schrieb Mario Graziosi:

>
> I wish to extend the standard admin "change_form": which is the  
> best way
> to do it?
>
> The specific problem I need to solve is to find a workaround to a  
> Django
> bug (Ticket #2522). I need to keep form header, footer and submit
> buttons and store my own stuff. I found this possible solution:
> 1. create my own copy of "change_form.html"
> 2. create a block for the piece of template I wish to extend/replace
> 3. create a new form which inherits from the "change_form.html"
>
> However, how do I tell to the admin engine that, for a given model, a
> form other than "change_form.html" should be used? I suspect the  
> correct
> place to tell it is in urls.conf, but how should I change the line  
> below
> to accomplish that?
>
> (r'^admin/', include('django.contrib.admin.urls')),
>
>
>
>
>
> >


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Best way to extend admin change_form?

2006-11-05 Thread Mario Graziosi

I wish to extend the standard admin "change_form": which is the best way 
to do it?

The specific problem I need to solve is to find a workaround to a Django 
bug (Ticket #2522). I need to keep form header, footer and submit 
buttons and store my own stuff. I found this possible solution:
1. create my own copy of "change_form.html"
2. create a block for the piece of template I wish to extend/replace
3. create a new form which inherits from the "change_form.html"

However, how do I tell to the admin engine that, for a given model, a 
form other than "change_form.html" should be used? I suspect the correct 
place to tell it is in urls.conf, but how should I change the line below 
to accomplish that?

(r'^admin/', include('django.contrib.admin.urls')),





--~--~-~--~~~---~--~~
 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: Installation failed on Ubuntu 5.10

2006-11-05 Thread Jeremy Dunck

On 11/1/06, fabio-ts <[EMAIL PROTECTED]> wrote:
>
> Hi, I tried to install Django-0.95 in /usr/lib/python2.4, then entered
> the dir Django-0.95 and started setup.py file. An error occurred giving
> this response:
>
> "error: invalid Python installation: unable to open
> /usr/lib/python2.4/config/Makefile (No such file or directory)"

You'll want to remove what you put in /usr/lib/python2.4, download
0.95 to some temporary directory, and then run sudo python setup.py
install; this will put the appropriate files into site-packages.

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



edit_inline=models.TABULAR and easy delete?

2006-11-05 Thread Franklin Kingma

Hello list,

I'm looking for an easy way to delete related objects shown in the  
'edit_inline=models.TABULAR' - view.

At the moment I use an hacked edit_inline_tabular.html template, I  
append each row with an delete button and with some javascript I  
change the location to delete the object, it works, but hacking the  
admin templates... it makes me feel dirty, so I was wondering if  
there is a better way to do it?


franklin





--~--~-~--~~~---~--~~
 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: Automatically starting the FastCGI server

2006-11-05 Thread Grigory Fateyev

Hello orestis!
On Fri, 03 Nov 2006 18:53:26 - you wrote:

> 
> Hello,
> 
> I'm new to linux administration, but I try to learn :)
> 
> I have managed to make lighttpd and postgresql start automatically
> upon reboot, now I need a way to make manage.py runfcgi to start
> automatically.
[...] 
> Has anyone made this work ? An init.d script would be nice too, as I'd
> like to run the django fcgi server under a different user.

What OS you are working on? If Debian, can help you...

-- 
Всего наилучшего! Григорий
greg [at] anastasia [dot] ru
Письмо отправлено: 2006/11/05 18:32

--~--~-~--~~~---~--~~
 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: Random ProgrammingErrors when using PostgreSQL

2006-11-05 Thread orestis

And for anyone searching this:

http://www.djangoproject.com/documentation/django_admin/#sqlsequencereset-appname-appname


--~--~-~--~~~---~--~~
 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: Random ProgrammingErrors when using PostgreSQL

2006-11-05 Thread orestis

HURRAY I fixed it.

For the record, this was my problem - no bug in Django.

I have imported semi-automatically some values from a previous version
of my app. I had to use the same Primary keys in order to keep all the
relations. However, I didn't adjusted the postgres sequences, so they
tried to insert primary keys which already existed.

It's strange I didn't get the error though. I had to use the python
shell to find that out.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



(Admin) user logged in in model field

2006-11-05 Thread Picio

Hello, can someone help?

I have a web app, that works pretty well just with the admin interface
! (very nice BTW)
This is a model I have:

class operation(models.Model):
descr= models.TextField()
data = models.DateField('giorno')
time_spent = models.FloatField(max_digits=2, decimal_places=1,
help_text ='Usare il punto, non la virgola!')
project = models.ForeignKey(project)
job_type = models.ForeignKey(job_type)

.I need to add a logged_user here 

I need to store also the 'user'  (the one that is logged in the admin
interface) which add a particular operation in my blog. I mean, the
user don't has to be choosed, but It has to be the one that is adding
the operation. I need that it works behind the scenes like the Welcome
message up right of any page: Welcome [user]...

Of course this is not only at the template level.

I have tried adding:
from django.contrib.auth.models import User  <  at the top of my models.py
.
user = models.ForeignKey(User)  <  after job_type
in my 'operation' model.

But this is not what I need, because every user need to store just
himself for any 'operation'
He do.  This way I obtain a drop down list with all the users and it's not good.

Sorry for my english, and 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: Random ProgrammingErrors when using PostgreSQL

2006-11-05 Thread orestis

I get this back:

[{'sql': 'SELECT
"django_session"."session_key","django_session"."session_data","django_session"."expire_date"
FROM "django_session" WHERE ("django_session"."session_key" =
d3b9c68e8d397b3fc0809ce5102e0299 AND "django_session"."expire_date" >
2006-11-05 13:39:36.338000)', 'time': '0.010'}, {'sql': 'SELECT 1 FROM
"django_session" WHERE "session_key"=d3b9c68e8d397b3fc0809ce5102e0299
LIMIT 1', 'time': '0.000'}, {'sql': 'UPDATE "django_session" SET
"session_data"=KGRwMQpTJ2xhc3RfdHJhbnMnCnAyCmNkYXRldGltZQpkYXRldGltZQpwMwooUydceDA3XHhkNlx4\nMGJceDA0XHgxNTggXHgwNFF4Jwp0UnA0CnNTJ19hdXRoX3VzZXJfaWQnCnA1CkkxCnNTJ19hdXRo\nX3VzZXJfYmFja2VuZCcKcDYKUydkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFj\na2VuZCcKcDcKc1MnbGFzdF9zZWVuJwpwOApnMwooUyJceDA3XHhkNlx4MGJceDA1XHInJFx4MDUo\nUCIKdFJwOQpzLmY4MTk1ZTU1ZjI4MGIwZTgyNTE1ZjUxZjhjMTMwNGE0\n,"expire_date"=2006-11-19
13:39:36.368000 WHERE "session_key"=d3b9c68e8d397b3fc0809ce5102e0299',
'time': '0.000'}, {'sql': 'SELECT
"auth_user"."id","auth_user"."username","auth_user"."first_name","auth_user"."last_name","auth_user"."email","auth_user"."password","auth_user"."is_staff","auth_user"."is_active","auth_user"."is_superuser","auth_user"."last_login","auth_user"."date_joined"
FROM "auth_user" WHERE ("auth_user"."id" = 1)', 'time': '0.000'}]

I tried running it on my local PostGres, and it seems that the date and
session key should be quoted... or maybe not ?


--~--~-~--~~~---~--~~
 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: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at

2006-11-05 Thread Ivan Sagalaev

Andy wrote:
> http://paste.e-scribe.com/2598/
> 
> Check it out!

Wouldn't {% ifequal forloop.counter 1 %} ) (without quotes around 1) do 
the trick?

--~--~-~--~~~---~--~~
 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: Brasilian fellow with charcode problem...

2006-11-05 Thread Igor Guerrero Fonseca

In Django templates are text-based so if you write some HTML/X-HTML/XML
you most use some code for example: ñ = ñ

You can use http://www.nvu.com/index.php or your favorite html editor to
write your markup and then watch for the source code

> Hi,
> 
> I had the same problem in Spanish.
> 
> You must save your templates as UTF-8. For example, in Windows Notepad
> you can do a save-as and choose UTF- as encoding, instead of ASCII.
> 
> Hope it helps,
> 
> G
> 
> On 11/1/06, Italo Maia <[EMAIL PROTECTED]> wrote:
> >
> > Well, here's the problem, in portuguese(my idiom), we have chars like
> > '�' and '�' and '�', and i'm having trouble rendering these in my
> > templates. Here's a example:
> >
> > 
> >  > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > http://www.w3.org/1999/xhtml"; >
> > 
> >  > http-equiv="content-type"  />
> > 
> > 
> > Ol� mundo
> > 
> > 
> >
> > the tag "Ol� mundo" is showed like "Ol? mundo".
> > setting.py language code is set ( LANGUAGE_CODE = 'pt-br' ) and all my
> > .py files starts with
> > # -*- coding: utf-8 -*-
> >
> > How do i fix 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: Brasilian fellow with charcode problem...

2006-11-05 Thread Guillermo Fernandez Castellanos
Hi,

I had the same problem in Spanish.

You must save your templates as UTF-8. For example, in Windows Notepad
you can do a save-as and choose UTF- as encoding, instead of ASCII.

Hope it helps,

G

On 11/1/06, Italo Maia <[EMAIL PROTECTED]> wrote:
>
> Well, here's the problem, in portuguese(my idiom), we have chars like
> '�' and '�' and '�', and i'm having trouble rendering these in my
> templates. Here's a example:
>
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml"; >
> 
>  http-equiv="content-type"  />
> 
> 
> Ol� mundo
> 
> 
>
> the tag "Ol� mundo" is showed like "Ol? mundo".
> setting.py language code is set ( LANGUAGE_CODE = 'pt-br' ) and all my
> .py files starts with
> # -*- coding: utf-8 -*-
>
> How do i fix 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: inclusion tag for login screen.

2006-11-05 Thread Guillermo Fernandez Castellanos

Check this:
http://brehaut.net/blog/2006/08/21/django-user-logins/

If you want a complete and working example, tell me and I'll send you one.

Hope it helps,

G

On 11/1/06, MerMer <[EMAIL PROTECTED]> wrote:
>
> I am thinking about creating a small login form as an inclusion tag, to
> display within other pages created by generic views, when the user has
> not been authenticated.
>
> Creating a tag that displays a form seems simple enough.  However, I
> want to log the user on without them leaving the page they are on.
> Anybody,  have a way to do this?
>
> Secondly, is there a way to use a form as an inclusion tag - and still
> use custom manipulators.
> Do I pass the details of custom manipulator etc back to the template
> from the inclusion tag?
>
> Cheers
>
> MerMer
>
>
> >
>

--~--~-~--~~~---~--~~
 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: A question about for loop in templates

2006-11-05 Thread Ivan Sagalaev

Vizcayno wrote:
> info_dict = { 'data': lst,
>'poscol': ( 2,0,11,29,18,..)
> return render_to_response('pres_marcaciones.html', info_dict)

Instead of passing this two pieces into template and handle them there 
you should do this right in the view and pass already constructed table 
to the template. (This is essentially how Django's templates encourage 
you to keep all logic in one place - the view).

So it can be done like this:

 table = []
 for row in lst:
   values = [row[index] for index in (2, 0, 11, 29)]
   table.append(values)

 return render_to_response('...', {'table': table})

And then in the template you have a simple list of lists that you can 
easily traverse with nested 'for' loops.

--~--~-~--~~~---~--~~
 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: I am really new, but I found a few problems using it, or am I wrong?

2006-11-05 Thread James Bennett

On 11/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> In file "ez_setup.py", a configuration line should be
> DEFAULT_VERSION = "0.6c3"
> in stead of
> DEFAULT_VERSION = "0.6c1"

The ez_setup.py and the corresponding things it used have actually
been removed since the 0.95 release; having to constantly make minor
changes like the one you point out, and the requirements it imposed on
the installation process, just weren't worth it. Django now just uses
the standard Python distutils instead of setuptools.

> Secondly, I was trying to connect it to the database, then I added a
> line of DATABASE_ENGINE = "sqlite3" to the settings.py file and
> configured the DATABASE_NAME as the directory. Then I got a traceback
> error when I was trying to execute "python manage.py syncdb", it saids
> that one file is trying to import an unexisting module in python 2.5.
> The module name is "pysqlite2", and it is not in python module folder.

This is mostly a Python 2.4 -> 2.5 compatibility issue; at the time
Django 0.95 was released, Python 2.5 had not been released, so Django
0.95 relies on the old third-party SQLite module instead of the one
that comes with Python 2.5. The current Django trunk (which you can
get by following the instructions for installing the development
version) was updated shortly after the Python 2.5 release to include
some extra logic to check whether it's running under Python 2.5 (in
which case it uses Python 2.5's built-in SQLite module) or an earlier
version (in which case it will require the old third-party SQLite
module).


-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
 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: Re: Django Admin - "Site administration"

2006-11-05 Thread James Bennett

> Carl Holm wrote:
> It's probably obvious, but after searching the docs and beyond, I have
> not been able to locate the origin of  "Site administration",
> which appears in the title and as an h1 heading on the initial admin page.

It's in this template:
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templates/admin/base_site.html

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
 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: Django Admin - "Site administration"

2006-11-05 Thread frank h.

hej carl,
check here
http://www.djangoproject.com/documentation/tutorial2/#customize-the-admin-look-and-feel
good luck
-frank

Carl Holm wrote:
> Hello,
>
> It's probably obvious, but after searching the docs and beyond, I have
> not been able to locate the origin of  "Site administration",
> which appears in the title and as an h1 heading on the initial admin page.
> 
> Thanks,
> 
> CL


--~--~-~--~~~---~--~~
 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: I am really new, but I found a few problems using it, or am I wrong?

2006-11-05 Thread [EMAIL PROTECTED]

Ok, I got it, I just need to download a pysqlite2 module and see how it
goes. I found this answer in Alex's Python in a Nutshell book page 300.
Realize that I need to go to http://www.sqlite.org and get this module.

The user manual could give a little bit more details so that people
with not much experience knows what to do.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Django Admin - "Site administration"

2006-11-05 Thread Carl Holm

Hello,

It's probably obvious, but after searching the docs and beyond, I have 
not been able to locate the origin of  "Site administration",
which appears in the title and as an h1 heading on the initial admin page.

Thanks,

CL


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---