Re: Non editable fields in admin

2008-07-05 Thread Alex Rades
You mean this?

http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowdoIchangetheattributesforawidgetonasinglefieldinmymodel
.

It seems there is quite a lot of code involved for each readonly field you
want do display... something like readonly_fields would be way better IMHO.

On Fri, Jul 4, 2008 at 10:19 PM, TiNo <[EMAIL PROTECTED]> wrote:

> How about creating a widget that just displays the data? Then override the
> form and use this widget instead of the default widget.
>
>
> On Fri, Jul 4, 2008 at 6:14 PM, Alex Rades <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>> I'm writing an application which makes a pretty heavy use of the
>> newforms-admin administrative site.
>>
>> One recurring need is displaying of informative fields (fields which
>> should not be editable from the admin site, but only viewed).
>> For example, imagine to have a DateField field into a Story class, which
>> is automatically updated every time a user writes a new story. It is
>> desiderable to see this value in the admin site, but has no sense (actually
>> is wrong) to allow modifications to it.
>>
>> Note that this is different from the purpose of the 'editable' attribute,
>> what I'm talking about is a presentation-only feature, and for this reason
>> we could put it into ModelAdmin classes:
>>
>> class StoryOptions(admin.ModelAdmin):
>> readonly_fields = ('lastupdate',)
>>
>> People have been asking this a lot of times, at least here:
>>
>> http://code.djangoproject.com/ticket/342
>> http://code.djangoproject.com/ticket/611
>> http://code.djangoproject.com/ticket/1714
>> http://code.djangoproject.com/ticket/3990
>>
>> Is there a working solution to display this kind of readonly data in the
>> admin site?
>>
>> Thank 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: Do you code django with Komodo?

2008-07-05 Thread joshuajonah

I'm not painfully familiar with the API/whatever to make Komodo
extensions, but i know enough python to get there. I can think of a
million things that would help me get django apps out there faster.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



pluggable django ticketing app?

2008-07-05 Thread chefsmart

Does anyone know of a pluggable django ticketing app? Something like
the apps used by webhosts for online support?
--~--~-~--~~~---~--~~
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: handling currency values

2008-07-05 Thread Eric Abrahamsen

Is this something that might belong in the humanize filters package?  
Either something like {{ quantity|currency }}, which takes the  
currency type from locale, if in use, or else explicitly with  
{{ quantity|currency:"USD" }}? It's not a great savings over just  
doing it from scratch, but that's the sort of thing that seems to  
belong in humanize...

E


On Jul 6, 2008, at 12:50 PM, Malcolm Tredinnick wrote:

>
>
> On Sun, 2008-07-06 at 14:43 +1000, Malcolm Tredinnick wrote:
>>
>> On Sat, 2008-07-05 at 21:23 -0700, Bobby Roberts wrote:
>>> what is the best way to handle currency values and then display in  
>>> the
>>> correct currency for the current location.  In the past, in other
>>> programming languages, I usually set the field type to decimal, 4
>>> places and then when I printed the value on the screen, I just used
>>> the included formatcurrency function which rounded to 2 decimal  
>>> places
>>> and put the right currency symbol.
>>
>> You must have also stored the currency as well, then, right? Not just
>> the amount, since 1.234 does not mean the same thing when prefixed by
>> EUR as it does when prefixed by AUD.
>>
>> Django has a decimal field, so that plus a field containing the  
>> currency
>> type and a short function should do the job here. There's nothing  
>> built
>> in to do that, since it's not really related to being a web framework
>> and is fairly straightforward to do in any case. One day (maybe even
>> soon), we'll allow model fields that correspond to multiple columns  
>> in
>> the database so that you can tie the amount and currency together  
>> (and
>> even have the "display me" function on the model field). That day  
>> isn't
>> here yet, however.
>
> By the way, there might be something in Christian Lenz's babel  
> project,
> which isn't Django-specific, but a collection of useful localisation
> utilities. I can't remember off-hand if there's something for currency
> formatting or not.
>
> Regards,
> Malcolm
>
>
>
> >


--~--~-~--~~~---~--~~
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: Strange MySQLdb error

2008-07-05 Thread Aaron

To answer my own question, turns out it's due to the fact that I have
a subdir called "site".
I believe this has some conflicts with Python and leads to this
strange behavior.
After renaming it to something else, the problem goes away.

-Aaron

On Jul 5, 7:13 pm, Aaron <[EMAIL PROTECTED]> wrote:
> So here's something really strange. I ran
>
> Python 2.5.2 (r252:60911, Jun 30 2008, 18:59:56)
> [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> 
> import sys
> >>> sys.path
>
> ['', '/home/user/run/lib/python2.5/site-packages/setuptools-0.6c8-
> py2.5.egg', '/home/user/run/lib/python2.5/site-packages/
> Django-0.97_pre-py2.5.egg', '/home/user/run/lib/python2.5/site-
> packages/MySQL_python-1.2.2-py2.5-linux-i686.egg', '/home/.winkler/
> user', '/home/user/lib/python', '/home/user/soft/django_src', '/home/
> user/django_projects', '/home/user/run/lib/python25.zip', '/home/user/
> run/lib/python2.5', '/home/user/run/lib/python2.5/plat-linux2', '/home/
> user/run/lib/python2.5/lib-tk', '/home/user/run/lib/python2.5/lib-
> dynload', '/home/user/run/lib/python2.5/site-packages']
>
> >>> import MySQLdb
>
> No errors at all. Notice that the MySQL_python-1.2.2 is correctly
> installed in the site-packages via easy install.
>
> Now I cd to myproject directory and ran python manage.py shell
> and I got:
>
> Traceback (most recent call last):
>   File "manage.py", line 12, in 
>     execute_manager(settings)
>   File "/home/user/soft/django_src/django/core/management/
> __init__.py", line 272, in execute_manager
>     utility.execute()
>   File "/home/user/soft/django_src/django/core/management/
> __init__.py", line 219, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/home/user/soft/django_src/django/core/management/base.py",
> line 72, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File "/home/user/soft/django_src/django/core/management/base.py",
> line 86, in execute
>     output = self.handle(*args, **options)
>   File "/home/user/soft/django_src/django/core/management/base.py",
> line 168, in handle
>     return self.handle_noargs(**options)
>   File "/home/user/soft/django_src/django/core/management/commands/
> shell.py", line 17, in handle_noargs
>     from django.db.models.loading import get_models
>   File "/home/user/soft/django_src/django/db/__init__.py", line 17, in
> 
>     backend = __import__('%s%s.base' % (_import_path,
> settings.DATABASE_ENGINE), {}, {}, [''])
>   File "/home/user/soft/django_src/django/db/backends/mysql/base.py",
> line 12, in 
>     raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
>
> Python 2.5.2 (r252:60911, Jun 30 2008, 18:59:56)
> [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> 
> import sys
> >>> sys.path
>
> ['', '', '/home/user/lib/python', '/home/user/soft/django_src', '/home/
> user/django_projects', '/home/user/run/lib/python25.zip', '/home/user/
> run/lib/python2.5/', '/home/user/run/lib/python2.5/plat-linux2', '/
> home/user/run/lib/python2.5/lib-tk', '/home/user/run/lib/python2.5/lib-
> dynload']>>> import MySQLdb
>
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named MySQLdb
>
> It looks like the site packages are removed _AFTER_ I ran the python
> manage.py??
>
> Looking at manage.py, it doesn't really do much so I expect somehow
> inside execute_manger it's modifying sys.path??
>
> Any ideas?
>
> -Aaron
--~--~-~--~~~---~--~~
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: handling currency values

2008-07-05 Thread Malcolm Tredinnick


On Sun, 2008-07-06 at 14:43 +1000, Malcolm Tredinnick wrote:
> 
> On Sat, 2008-07-05 at 21:23 -0700, Bobby Roberts wrote:
> > what is the best way to handle currency values and then display in the
> > correct currency for the current location.  In the past, in other
> > programming languages, I usually set the field type to decimal, 4
> > places and then when I printed the value on the screen, I just used
> > the included formatcurrency function which rounded to 2 decimal places
> > and put the right currency symbol. 
> 
> You must have also stored the currency as well, then, right? Not just
> the amount, since 1.234 does not mean the same thing when prefixed by
> EUR as it does when prefixed by AUD.
> 
> Django has a decimal field, so that plus a field containing the currency
> type and a short function should do the job here. There's nothing built
> in to do that, since it's not really related to being a web framework
> and is fairly straightforward to do in any case. One day (maybe even
> soon), we'll allow model fields that correspond to multiple columns in
> the database so that you can tie the amount and currency together (and
> even have the "display me" function on the model field). That day isn't
> here yet, however.

By the way, there might be something in Christian Lenz's babel project,
which isn't Django-specific, but a collection of useful localisation
utilities. I can't remember off-hand if there's something for currency
formatting or not.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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: handling currency values

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 21:23 -0700, Bobby Roberts wrote:
> what is the best way to handle currency values and then display in the
> correct currency for the current location.  In the past, in other
> programming languages, I usually set the field type to decimal, 4
> places and then when I printed the value on the screen, I just used
> the included formatcurrency function which rounded to 2 decimal places
> and put the right currency symbol. 

You must have also stored the currency as well, then, right? Not just
the amount, since 1.234 does not mean the same thing when prefixed by
EUR as it does when prefixed by AUD.

Django has a decimal field, so that plus a field containing the currency
type and a short function should do the job here. There's nothing built
in to do that, since it's not really related to being a web framework
and is fairly straightforward to do in any case. One day (maybe even
soon), we'll allow model fields that correspond to multiple columns in
the database so that you can tie the amount and currency together (and
even have the "display me" function on the model field). That day isn't
here yet, however.

Regards,
Malcolm


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



handling currency values

2008-07-05 Thread Bobby Roberts

what is the best way to handle currency values and then display in the
correct currency for the current location.  In the past, in other
programming languages, I usually set the field type to decimal, 4
places and then when I printed the value on the screen, I just used
the included formatcurrency function which rounded to 2 decimal places
and put the right currency symbol.  what's the best way to do this in
django?


thanks for your input
BR
--~--~-~--~~~---~--~~
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: escaping

2008-07-05 Thread Bobby Roberts

On Jul 5, 4:15 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
> Already tried it without the extra spaces?
>
> {{ request.session.AccountNum|escape }}
>
> MfG, Horst


man i really thought that had spaces in it in the docs... thanks for
the clarification
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Strange MySQLdb error

2008-07-05 Thread Aaron

So here's something really strange. I ran

Python 2.5.2 (r252:60911, Jun 30 2008, 18:59:56)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/user/run/lib/python2.5/site-packages/setuptools-0.6c8-
py2.5.egg', '/home/user/run/lib/python2.5/site-packages/
Django-0.97_pre-py2.5.egg', '/home/user/run/lib/python2.5/site-
packages/MySQL_python-1.2.2-py2.5-linux-i686.egg', '/home/.winkler/
user', '/home/user/lib/python', '/home/user/soft/django_src', '/home/
user/django_projects', '/home/user/run/lib/python25.zip', '/home/user/
run/lib/python2.5', '/home/user/run/lib/python2.5/plat-linux2', '/home/
user/run/lib/python2.5/lib-tk', '/home/user/run/lib/python2.5/lib-
dynload', '/home/user/run/lib/python2.5/site-packages']
>>> import MySQLdb

No errors at all. Notice that the MySQL_python-1.2.2 is correctly
installed in the site-packages via easy install.

Now I cd to myproject directory and ran python manage.py shell
and I got:

Traceback (most recent call last):
  File "manage.py", line 12, in 
execute_manager(settings)
  File "/home/user/soft/django_src/django/core/management/
__init__.py", line 272, in execute_manager
utility.execute()
  File "/home/user/soft/django_src/django/core/management/
__init__.py", line 219, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/user/soft/django_src/django/core/management/base.py",
line 72, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/home/user/soft/django_src/django/core/management/base.py",
line 86, in execute
output = self.handle(*args, **options)
  File "/home/user/soft/django_src/django/core/management/base.py",
line 168, in handle
return self.handle_noargs(**options)
  File "/home/user/soft/django_src/django/core/management/commands/
shell.py", line 17, in handle_noargs
from django.db.models.loading import get_models
  File "/home/user/soft/django_src/django/db/__init__.py", line 17, in

backend = __import__('%s%s.base' % (_import_path,
settings.DATABASE_ENGINE), {}, {}, [''])
  File "/home/user/soft/django_src/django/db/backends/mysql/base.py",
line 12, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: No module named MySQLdb


Python 2.5.2 (r252:60911, Jun 30 2008, 18:59:56)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '', '/home/user/lib/python', '/home/user/soft/django_src', '/home/
user/django_projects', '/home/user/run/lib/python25.zip', '/home/user/
run/lib/python2.5/', '/home/user/run/lib/python2.5/plat-linux2', '/
home/user/run/lib/python2.5/lib-tk', '/home/user/run/lib/python2.5/lib-
dynload']
>>> import MySQLdb
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named MySQLdb

It looks like the site packages are removed _AFTER_ I ran the python
manage.py??

Looking at manage.py, it doesn't really do much so I expect somehow
inside execute_manger it's modifying sys.path??

Any ideas?

-Aaron



--~--~-~--~~~---~--~~
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: raising HttpResponseBadRequest throws Exception Type error?

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 18:58 -0700, Rob Hudson wrote:
[...]
> * Shouldn't all HTTP error code raising function similarly?  Shouldn't
> I be able to raise a 400 error the same as a 404?

Not really.

Django has a 404 exception as a quick bail out for when something is
missing and it and PermissionDenied are treated specially in the
response handlers (although it's often not appropriate to let your code
rely on that default handling). However, HTTP response codes are really
a consequence of other errors -- they are a way to communicate that a
certain type of error occured back to the client. Having an exception
for every possible response code is really overkill here, since it means
you'll be raising status-code-related exceptions instead of more
semantic ones.

Create your own "BadAPIVoodoo" exception, catch it in your view and
return an HttpResponseBadRequest class. That enables you to write code
that isn't tied to the HTTP processing pipeline and where the exceptions
are more descriptive if they don't end up being routed straight to the
user.

You could compromise and create "RobsOwnHTTPException" that takes a
status code and a message and then your view wrapper can convert it to
the right request type. :-)

Of course, all this is (my very own) personal opinion. But I have a lot
of reusable code fragments (functions of half a dozen to a few dozen
lines) that I'm using in multiple places and multiple projects and I
think they're much stronger from raising well-named exceptions rather
than going directly to HTTP response codes. Because I don't always raise
the same response code for the same exception type, For example, if
somebody tries to look up something about a member on one site, they get
a 404 if the URL doesn't exist and they're a site admin or a "permission
denied" if they wouldn't be able to view that member under any
circumstances. The code determining the existence of the resource
doesn't know that, though.

> * Shouldn't Django be consistent in its own raising of errors and
> choose one way to do it (e.g. choose #1 above over #2)?  Out of
> curiosity I grep'd the code to count how many chose the paren method
> vs the comma method:

Meh. They're both perfectly valid Python and people should be able to
read either. It really makes no significant difference at all. I tend to
use the parenthesised version in my own code (partly because it's easier
to split across multiple lines), but the other form is just as readable.

The drawback of making somewhat arbitrary changes like this is that it
means the "last changed" date on that line changes when viewing it
through "svn annotate" or similar and that information is often pretty
useful for tracking down bugs: you can see that "this block of code was
all changed at once" at a glance. Yes, some people get very determined
that everything should be consistent, but this does fall into the trap
of continually rewriting the code to match evolving styles and that's a
productivity and maintainability sinkhole. As long as something isn't
unnecessarily complex or unreadable, existing code will normally not be
worth a rewrite.

Regards,
Malcolm


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



raising HttpResponseBadRequest throws Exception Type error?

2008-07-05 Thread Rob Hudson

In my code for an API it made sense to me to import and raise
`HttpResponseBadRequest ` when the API was given bad data to work
with.  I'm importing and raising the error like this:

from django.http import Http404, HttpResponseBadRequest
raise HttpResponseBadRequest, "Invalid data"

But when I do that, I get a TypeError:

Exception Type: TypeError at /api/v1/clips/new/
Exception Value: exceptions must be classes, instances, or strings
(deprecated), not type

I thought this was similar to Http404 until I looked at the code in
django/http/__init__.py and see that the Http404 is subclassing
Exception while most of the other "errors" subclass HttpResponse.  And
there is even a HttpResponseNotFound that has a status_code of 404 to
confuse matters even more.

I also grep'd the codebase to see what was the proper way to raise an
error and saw two ways:

1) raise Http404("Error message here.")
2) raise Http404, "Error message here."

I tried both for my `HttpResponseBadRequest` and still got a type
error.  Following the logic that this is just a subclasses
HttpResponse I changed it to a return:

return HttpResponseBadRequest("Error message here.")

and that worked.

In the end I was a bit confused by all of this and came away wondering:

* Shouldn't all HTTP error code raising function similarly?  Shouldn't
I be able to raise a 400 error the same as a 404?

* Shouldn't Django be consistent in its own raising of errors and
choose one way to do it (e.g. choose #1 above over #2)?  Out of
curiosity I grep'd the code to count how many chose the paren method
vs the comma method:

~/sandbox/django/django_trunk/django > egrep -R 'raise \w+\(.*' * |
grep -v .svn | wc -l # paren method
 371
~/sandbox/django/django_trunk/django > egrep -R 'raise \w+,.*' * |
grep -v .svn | wc -l # comma method
 184

-Rob

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

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 06:17 -0700, Bobby Roberts wrote:
> Can Django interact with XML or would it be a view i write that does
> it?  I'm putting in the last place of a payment gateway and need to
> know which direction to take.

Your question is ambiguous. Interact how?

Django's view functions accept any data sent to them via an HTTP
connection. You can do whatever you like in the view to process the
data. So the answer is almost certainly yes and not even tricky, but
since you asked the question, maybe you're actually meaning something
else. So perhaps some clarification would help us to help you.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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: non editable admin model

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 06:16 -0700, Bobby Roberts wrote:
> anyone know if this can be done without modifying the actual django
> installation on the server.  Surely it can be done through passing
> settings to the admin in the model or a settings in the settings file
> but I can't find any documentation on it.

It's not documented because the admin interface isn't designed for this.
The admin interface is for people who have permission to edit and change
things. It's not a view-only interface.

Malcolm



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



Issue with setting up FastCGI

2008-07-05 Thread TBS

I'm getting this problem:

[EMAIL PROTECTED]:~/wiggle$ ./manage.py runfcgi
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/flup/server/fcgi_base.py",
line 558, in run
protocolStatus, appStatus = self.server.handler(self)
  File "/var/lib/python-support/python2.4/flup/server/fcgi_base.py",
line 1112, in handler
result = self.application(environ, start_response)
  File "/var/lib/python-support/python2.4/django/core/handlers/
wsgi.py", line 189, in __call__
response = self.get_response(request)
  File "/var/lib/python-support/python2.4/django/core/handlers/
base.py", line 59, in get_response
response = middleware_method(request)
  File "/var/lib/python-support/python2.4/django/middleware/
common.py", line 41, in process_request
if settings.APPEND_SLASH and (old_url[1][-1] != '/') and ('.' not
in old_url[1].split('/')[-1]):
IndexError: string index out of range
Content-Type: text/html



Unhandled Exception

Unhandled Exception
An unhandled exception was thrown by the application.



This is the directory structure
/home/vanths/www/

wiggle/
 __init__.py
 manage.py
 public /
 django.fcgi
 . htaccess
 Media /
settings.py
urls.py
=

Here are the files I set up in a "public" directory under wiggle:

1.  [EMAIL PROTECTED]:~/wiggle$ more public/django.fcgi
#!/usr/bin/python
import os, sys

sys.path.insert (0, "/home/vanths/www/")
os.chdir ('..')
os.environ [ 'DJANGO_SETTINGS_MODULE'] = "wiggle.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

2.  [EMAIL PROTECTED]:~/wiggle$ more public/.htaccess
public/.htaccess: No such file or directory
[EMAIL PROTECTED]:~/wiggle$ more public/.Htaccess
AddHandler fcgid-script. Fcgi
RewriteEngine On
RewriteCond% (REQUEST_FILENAME)!-F
RewriteRule ^(.*)$ django.fcgi / $ 1 [QSA, L]


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



Issue with django-tagging 0.3 (svn) with models definition

2008-07-05 Thread Nicolas Steinmetz

Hello,

Despite I read a lot of time the overview.txt on the django tagging svn
repository, I still can't stand how to use it at my model's level. I'm
quite new to python and may miss some elements.

When diving into the register part, it says it requiers a field for tag
which is supposed to be "tags". But what kind of type is this tag supposed
to be ? a TagField() ?

I came down to this kind of things which looks not the optimum for me (at
least at validate & runserver step, it stops shouting...):

from django.db import models
import tagging
from tagging.models import Tag
from tagging.fields import TagField

# Create your models here.
class Links(models.Model):
title = models.CharField(max_length=80)
description = models.TextField()
url = models.URLField()
tags = TagField()

class Admin:
list_display = ('title', 'description', 'url', 'tags',)
list_filter = ['title', 'tags']
search_fields = ['title','tags',]

class Meta:
verbose_name = "Lien"
verbose_name_plural = "Liens"

tagging.register(Links)

But when I try to save a link, I got :

IntegrityError at /admin/links/links/add/
tagging_taggeditem.object_id may not be NULL

What did I miss ?

Regards,
Nicolas

-- 
Nicolas Steinmetz
http://www.steinmetz.fr/
http://www.unelectronlibre.info/


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

2008-07-05 Thread Horst Gutmann

Already tried it without the extra spaces?

{{ request.session.AccountNum|escape }}

MfG, Horst


On Sat, Jul 5, 2008 at 10:13 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote:
> I'm trying to escape something printed back to a template as follows
>
>
> {{request.session['AccountNum'] | escape }}
>
> and i'm getting this error:
>
> Could not parse the remainder: ' | escape' from
> 'request.session.AccountNum | escape'
>
>
> From what I can tell i'm using the right syntax... am I missing
> something here?
>
>
> BR
> >
>

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



escaping

2008-07-05 Thread Bobby Roberts

I'm trying to escape something printed back to a template as follows


{{request.session['AccountNum'] | escape }}

and i'm getting this error:

Could not parse the remainder: ' | escape' from
'request.session.AccountNum | escape'


>From what I can tell i'm using the right syntax... am I missing
something here?


BR
--~--~-~--~~~---~--~~
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: MySQL Errors Using syncdb

2008-07-05 Thread Arif

Karen,

You were spot on it was an error in the models file, thank you so so
much!
Very much appreciated.

On Jul 5, 5:45 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sat, Jul 5, 2008 at 3:03 AM, Arif <[EMAIL PROTECTED]> wrote:
> > Thanks for your reply but I don't think it is a problem with the
> > models, the same scripts work on my old Windows machine on localhost,
> > and the scripts work on my production linux server.
>
> > I have only had this problem since I installed Django on my new
> > Macbook Pro, sorry I should have mentioned that.
>
> You may not think your models file is the problem, but the fact that your
> model code is present in the traceback:
>
>   File
>
> > "/Library/Python/2.5/site-packages/django/core/management/validation.py",
> > line 60, in get_validation_errors
> >    for c in f.choices:
> >  File "/Users/Arif/Sites/Acquisition
> > App/acquisitionapp/../acquisitionapp/app/models.py", line 184, in __iter__
> >    for o in Organisation.objects.filter(models.Q(administrator=user) |
> > models.Q(participants=user)).distinct():
>
> points to your models file being a trigger for the problem.  Thus sharing it
> with us would make it easier to help you.  The error is that when this line
> of code is executed, the Organisation table does not exist in the database.
> It is possible you did not see this error on your Windows development/Linux
> production machines because you first created a models.py file that included
> the Organisation, ran syncdb on that, which created the Organisation table,
> and only later added the code that relies on the table existing.  Now you
> are starting afresh on a new machine you run into trouble because on the new
> machine's database the table doesn't yet exist.  But I'm just guessing based
> on the limited information you've provided.
>
> I do not think the error has anything to do with Macbook Pro vs. Windows or
> Linux.  There are plenty of people running on Macs and I can't recall any
> similar problems posted in relation to Macs.  Which, again, argues for it
> being something in your code that is causing the error.
>
> Karen
--~--~-~--~~~---~--~~
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: Copyright issues for an application developed using django, python and mySQL

2008-07-05 Thread Nagu

Thank you again. I will start a discussion with our company lawyers
regarding this.

On Jul 4, 7:21 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-07-04 at 19:03 -0700, Nagu wrote:
> > Thank you very much for your explanations. From the above
> > explanations, I can infer that I do not have to worry about any
> > copyright or licensing issues. Please correct me if I am wrong.
>
> Well, you have to respect them and know what the valid licensing issues
> are. But they probably don't interfere with what you're trying to do.
> With all due respect, if your company is worried about this, the only
> correct answer is "talk to a lawyer". Open Source licenses aren't
> particularly hard to understand, but when they are also interacting with
> distributed proprietary stuff and when a corporation is worried about
> their liabilities, taking advice solely from an internet mailing list is
> probably not a good idea.
>
> But Open Source software is designed to be used. Freely and without
> onerous restrictions. So the sort of stuff you're talking about is
> exactly in line with those goals.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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: Type error: Cannot resolve keyword 'name' into field

2008-07-05 Thread roj

the following link might be helpful
http://django.freelancernepal.com/topics/errors/
Cheers!

On Jul 4, 11:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I'm having troubles with an admin portion. I am brand new at django,
> so any help would be greatly appreciated. I am trying to make a class
> of family members.
>
> This works correctly when I use the admin to add new names to it. But
> when I try to change an element I get this error:
> TypeError at /admin/main/name/4/
> Cannot resolve keyword 'name' into field
>
> here is my class:
> class Name(models.Model):
> first_name = models.CharField(maxlength=40, blank=True,null=True)
> middle_name = models.CharField(maxlength=40, blank=True,null=True)
> last_name = models.CharField(maxlength=40, blank=True,null=True)
> suffix = models.CharField(maxlength=4,choices=SUFFIX_CHOICES,
> blank=True, null=True)
> gender=models.CharField(maxlength=1, choices=GENDER_CHOICES,
> blank=True, null=True)
> birth_state = models.CharField(maxlength=30, blank=True,
> null=True)
> birth_country = models.CharField(maxlength=30, blank=True,
> null=True)
> death_state = models.CharField(maxlength=30, blank=True,
> null=True)
> death_country = models.CharField(maxlength=30, blank=True,
> null=True)
> birth_date=models.DateField(null=True,blank=True)
> death_date=models.DateField(null=True,blank=True)
> mother=models.ManyToManyField("self", blank=True, null=True)
> father=models.ManyToManyField("self", blank=True, null=True)
> sibblings=models.ManyToManyField("self" ,blank=True, null=True)
> kids=models.ManyToManyField("self",blank=True, null=True)
> spouse=models.ManyToManyField("self",blank=True,null=True)
>
> class Admin:
> pass
>
> def __str__(self):
> return '%s %s %s' % (self.first_name,self.last_name,
> self.suffix)
--~--~-~--~~~---~--~~
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: MySQL Errors Using syncdb

2008-07-05 Thread Karen Tracey
On Sat, Jul 5, 2008 at 3:03 AM, Arif <[EMAIL PROTECTED]> wrote:

> Thanks for your reply but I don't think it is a problem with the
> models, the same scripts work on my old Windows machine on localhost,
> and the scripts work on my production linux server.
>
> I have only had this problem since I installed Django on my new
> Macbook Pro, sorry I should have mentioned that.
>

You may not think your models file is the problem, but the fact that your
model code is present in the traceback:

  File
> "/Library/Python/2.5/site-packages/django/core/management/validation.py",
> line 60, in get_validation_errors
>for c in f.choices:
>  File "/Users/Arif/Sites/Acquisition
> App/acquisitionapp/../acquisitionapp/app/models.py", line 184, in __iter__
>for o in Organisation.objects.filter(models.Q(administrator=user) |
> models.Q(participants=user)).distinct():
>

points to your models file being a trigger for the problem.  Thus sharing it
with us would make it easier to help you.  The error is that when this line
of code is executed, the Organisation table does not exist in the database.
It is possible you did not see this error on your Windows development/Linux
production machines because you first created a models.py file that included
the Organisation, ran syncdb on that, which created the Organisation table,
and only later added the code that relies on the table existing.  Now you
are starting afresh on a new machine you run into trouble because on the new
machine's database the table doesn't yet exist.  But I'm just guessing based
on the limited information you've provided.

I do not think the error has anything to do with Macbook Pro vs. Windows or
Linux.  There are plenty of people running on Macs and I can't recall any
similar problems posted in relation to Macs.  Which, again, argues for it
being something in your code that is causing the error.

Karen

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

2008-07-05 Thread Milan Andric

On Sat, Jul 5, 2008 at 6:09 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is there any open source django based cms you would recommend?  Th
> eonlyone I've seen so far is PyLucid. What else is there?
>
> Thanks!

There's a couple of them available on code.google.com and elsewhere on
the net. But most of the time you use the framework to build a custom
CMS so instead of finding CMSs you will find applications.  That is
the general pattern, people release apps and a CMS is just a django
project using a specific set of installed apps, some custom and some
maintained elsewhere.

One interesting "CMS" I ran into lately is Pinax,
http://pinax.hotcluboffrance.com/ .

--
Milan

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

2008-07-05 Thread Bobby Roberts


> Is there any open source django based cms you would recommend?  Th
> eonlyone I've seen so far is PyLucid. What else is there?

I'm a noob but won't installing flat pages handle that for 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: "Eval" in templates?

2008-07-05 Thread Ned Batchelder
Now that you have an eval tag, maybe you don't need this, but I think 
Django already had a simpler solution to your problem:

Context:
buttonDecidedAtRunTime: 'button4.html'
thisPage: "/some/path"

blah.html:
{% include buttonDecidedAtRunTime %}

The argument to the include tag doesn't need to be a literal string, it 
can be a value from the context.  This has the added advantage that the 
common "{% include " in each of your button choices is factored out and 
appears only once, in blah.html.

--Ned.
http://nedbatchelder.com

Ben Kovitz wrote:
> Thanks for the encouragement, Alex.  This was so easy, it should be a
> first lesson in how to write a custom tag.  It took about 15 minutes
> and worked the first time!
>
>
> from django import template
>
> register = template.Library()
>
> @register.tag(name="eval")
> def do_eval(parser, token):
>try:
>   tagName, variableName = token.split_contents()
>except ValueError:
>   raise template.TemplateSyntaxError("%r requires a single
> argument: the name of the variable to evaluate as the body of a
> template" % tagName)
>
>return EvalNode(variableName)
>
>
> class EvalNode(template.Node):
>
>def __init__(self, variableName):
>   self.variableName = variableName
>
>
>def render(self, context):
>   t = template.Template(context[self.variableName])
>   return t.render(context)
>
>
>
>
> On Jul 4, 5:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>   
>> I don't think it would be difficult to implement, either as a block
>> tag, or as a regular tag with context.
>> 
> >
>
>
>   


--~--~-~--~~~---~--~~
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: "Eval" in templates?

2008-07-05 Thread Ben Kovitz

Thanks for the encouragement, Alex.  This was so easy, it should be a
first lesson in how to write a custom tag.  It took about 15 minutes
and worked the first time!


from django import template

register = template.Library()

@register.tag(name="eval")
def do_eval(parser, token):
   try:
  tagName, variableName = token.split_contents()
   except ValueError:
  raise template.TemplateSyntaxError("%r requires a single
argument: the name of the variable to evaluate as the body of a
template" % tagName)

   return EvalNode(variableName)


class EvalNode(template.Node):

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


   def render(self, context):
  t = template.Template(context[self.variableName])
  return t.render(context)




On Jul 4, 5:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I don't think it would be difficult to implement, either as a block
> tag, or as a regular tag with context.
--~--~-~--~~~---~--~~
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: syncdb

2008-07-05 Thread Kenneth Gonsalves


On 05-Jul-08, at 5:32 PM, Peter Melvyn wrote:

>>  Thanks a lot!!  I am used to rails.  Hopefully django will have some
>>  sort of db migrate ability in the future.
>
> Django has a separated project
> http://code.google.com/p/django-evolution/ for such task

it is a third party project

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/




--~--~-~--~~~---~--~~
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: Another error

2008-07-05 Thread lukas



On Fri, 4 Jul 2008 20:01:29 -0700 (PDT), Leaf <[EMAIL PROTECTED]>
wrote:
> 
> I really need to stop making assumptions about Python. Again, I
> assumed that the parameters wouldn't be case-sensitive. Most of my
> programming experience has been in BASIC and PHP, which aren't quite
> as picky. Thanks for all your help.

http://www.diveintopython.org/ might help you there - it's a good start for
python-beginners. 

Have fun!

-- 
Lukas


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

2008-07-05 Thread Bobby Roberts

Can Django interact with XML or would it be a view i write that does
it?  I'm putting in the last place of a payment gateway and need to
know which direction to take.

Thanks in advance

BR
--~--~-~--~~~---~--~~
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: non editable admin model

2008-07-05 Thread Bobby Roberts

anyone know if this can be done without modifying the actual django
installation on the server.  Surely it can be done through passing
settings to the admin in the model or a settings in the settings file
but I can't find any documentation on it.

BR
--~--~-~--~~~---~--~~
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: newsletter in django

2008-07-05 Thread sebey

ok I have been recomened mailman so I will have a look thanks

On Jul 3, 3:16 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> sebey wrote:
> > I am planning on making a newsletters so should I use django build-in
> > options or mailman or something else you would recomenmt
>
> I recommend mailman. It is scalable and proven mailing list software.> but I 
> am new
> > to web dev and python so therefore django as well but I have one
> > request that it is easy to mantain and costumize (costum signup in
> > like an ajax window as an example)
>
> Writing django views is very nice. You are free to use whatever
> JavaScript toolkit that suits your needs-- django doesn't force you to
> choose one.
>
> Hopefully this is helpful!
>
> Jeff Anderson
>
>  signature.asc
> 1KDownload
--~--~-~--~~~---~--~~
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: syncdb

2008-07-05 Thread Peter Melvyn

On 7/5/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>  Thanks a lot!!  I am used to rails.  Hopefully django will have some
>  sort of db migrate ability in the future.

Django has a separated project
http://code.google.com/p/django-evolution/ for such task

Peter

--~--~-~--~~~---~--~~
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: Failure to compile urls.py on startup

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 04:35 -0700, zobbo wrote:
[...]
> Comments welcomed. I'm not likely to make the same mistake again but
> interested to know if there's a solution for this. Besides the obvious
> "Don't ignore error messages" :)

If there's not already a ticket open for this in Trac (do a bit of
search around to see if there's anything similar), it'd be worth opening
one. We should look at this.

Improving error message reporting from the urlresolvers.py code is
something I want to work on; it's something that bites people from time
to time and is hard to debug. I think "not making the errors entirely
disappear" is probably part of that. Please do open a ticket (no need to
post back here when you do, it will be in Trac so it won't get lost) so
that we don't completely forget about this.

Regards,
Malcolm



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



Failure to compile urls.py on startup

2008-07-05 Thread zobbo

I've been working through "Practical Django Projects" by James Bennet.
I came across some unexpected behaviour which I wanted to share
regarding handling errors on startup within the urls configuration.

In the weblog application he talks you through, he discusses splitting
up urls.py into modules. You end up with four files within a urls
module.

  urls/entries.py
  urls/links.py
  urls/categories.py
  urls/tags.py

Now my tags.py module had an error in it. I had restarted the server
and sure enough when I went to the site (to the default entries view)
it was raised. The error was a missing model import in tags.py (and
that's what the error said to me). However, if I just ignored it and
refreshed the screen again the error did not appear again. I'm
guessing this is because Django assumes my url regexes have been
compiled and it doesn't run that code again to get the error.

So I'm sitting using the site thinking everything is fine but actually
there's a whole bunch of urls that don't work because (I'm assuming)
they would have been compiled in after the url/tags.py failed. Of
course I should not have ignored the error. I foolishly thought that
it was a 'glitch'. My bad.

However, should Django have 'known' that it's url loading had failed
and forced it to be redone when the next request came in? Could Django
know that in this instance? Having a site running with your url
configuration only partly loaded doesn't feel right to me.

Comments welcomed. I'm not likely to make the same mistake again but
interested to know if there's a solution for this. Besides the obvious
"Don't ignore error messages" :)

This was using the newforms-admin branch by the way, just in case
anything has changed there regarding this.

Ian
--~--~-~--~~~---~--~~
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 based CMS

2008-07-05 Thread Fernando Rodríguez

Hi,

Is there any open source django based cms you would recommend?  Th
eonlyone I've seen so far is PyLucid. What else is there?

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: Errorlist messages internalization/localization

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 12:42 +0200, Florencio Cano wrote:
> I had 'es_ES'. I have reviewed
> http://www.i18nguy.com/unicode/language-identifiers.html and I see
> that for spanish (Spain) I have to use 'es-ES' 

Well, that's some draft document with no actual standing. Django uses
the HTTP header version of combined languages, so it would be "es-es".
However, for "Spanish from Spain", simply "es" will do ("es-es"
shouldn't hurt anything, however, since it will fall back to "es").

> so I change it, execute
> manage.py syndb and execute the tests but I get the same. Now I try
> with 'es'. The same process and I get the same...Could be the problem
> in other place?

Try import settings from django.conf and printing out the value of
settings.LANGUAGE_CODE just before one of your strings that is meant to
be translated in the tests. For example, in a doctest you could write

>>> from django.conf import settings
>>> settings.LANGUAGE_CODE

It will end up as a failing test (since it prints out something and
nothing was expected), but you'll at least see what the value is set to.

I don't know what else to suggest. I did some quick checking over here
and changing the LANGUAGE_CODE setting changes the locale used to
translate the error strings.

Malcolm



--~--~-~--~~~---~--~~
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: Errorlist messages internalization/localization

2008-07-05 Thread Florencio Cano

I had 'es_ES'. I have reviewed
http://www.i18nguy.com/unicode/language-identifiers.html and I see
that for spanish (Spain) I have to use 'es-ES' so I change it, execute
manage.py syndb and execute the tests but I get the same. Now I try
with 'es'. The same process and I get the same...Could be the problem
in other place?

2008/7/5 Malcolm Tredinnick <[EMAIL PROTECTED]>:

> Is "es" set as the LANGUAGE_CODE setting in your particular settings
> file (which would mean that is the default locale setting for your
> site)?

--~--~-~--~~~---~--~~
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: Errorlist messages internalization/localization

2008-07-05 Thread Malcolm Tredinnick


On Sat, 2008-07-05 at 12:15 +0200, Florencio Cano wrote:
> Hi!
> In my app when I show the errors in errorlist because a wrong filled
> form it shows them in spanish (my language) but when I execute the
> tests (with assertContains) the messages in errorlist appear in
> english!
> How can I fix this?

The tests are always run with the language set to whatever the
LANGUAGE_CODE setting is in your settings file. This ensures that they
will give a predictable result each time.

Is "es" set as the LANGUAGE_CODE setting in your particular settings
file (which would mean that is the default locale setting for your
site)?

Regards,
Malcolm


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



Errorlist messages internalization/localization

2008-07-05 Thread Florencio Cano

Hi!
In my app when I show the errors in errorlist because a wrong filled
form it shows them in spanish (my language) but when I execute the
tests (with assertContains) the messages in errorlist appear in
english!
How can I fix this?

--~--~-~--~~~---~--~~
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: MySQL Errors Using syncdb

2008-07-05 Thread Arif

Thanks for your reply but I don't think it is a problem with the
models, the same scripts work on my old Windows machine on localhost,
and the scripts work on my production linux server.

I have only had this problem since I installed Django on my new
Macbook Pro, sorry I should have mentioned that.





On Jul 5, 1:05 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 4, 2008 at 6:01 PM, Arif <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I hope someone can shed some light on this as I have been trying to
> > get Django to work for hours and hours.
>
> > If I run a Django site that does not have a database connection the
> > localserver starts correctly, however if I run a site that requires a
> > database connection I get the following error when I run:
>
> > python manage.py syncdb
>
> [error traceback snipped]
>
> Posting the contents of your models.py file someplace like dpaste.com might
> help someone pinpoint what is going wrong.  You seem to have something in
> your models file called during validation that requires that the underlying
> database tables already exist.  Possibly something to do with choices
> specified on some field?
>
> Karen
--~--~-~--~~~---~--~~
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: custom form with admin look and feel

2008-07-05 Thread chefsmart

@Ayaz: I tried what you suggested, but the alignment of fields etc
goes off for me. Is it possible for you to post an example django
template, maybe on dpaste.com. Also I don't quite understand where all
the javascript in the change_form is coming from..



On Jun 30, 8:29 pm, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote:
> chefsmart wrote:
> > I'm using django svn trunk. I have created several custom forms that
> > show up in theadminsection of the website. However, these formslook
> > nothing like theadminforms. I tried extending change_form.html
> > template - unsuccessfully.
>
> > Does anyone know what my template should contain to achieveadminlook
> > andfeel.
>
> > Thanks...
>
> Here is what I have been doing.  I have been required to modify the
> change_form templates in theadminfor some of the models.  I open the
> "add model item" page, view the source of the page, and copy the HTML
> to a note pad.  I then hack it, and use it to make the custom
> change_form template.  I only copy and hack the HTML within the
> "breadcrumb" and "body content" blocks.  The blocks above those, I
> copy from the change_form.html template provided in 
> django/contrib/admin/templates/admin.  The custom pages I have madelookno 
> different
> than the DjangoAdminones.  ;)
>
> --
> Ayaz Ahmed Khan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---