Re: pure-HTTP deployment?

2006-12-23 Thread Jeremy Dunck


On 12/24/06, Chris Lee-Messer <[EMAIL PROTECTED]> wrote:

ps. I do not actually know very much about twisted but have had it on
my list of things to explore for a long time.


I'm starting a django-related twisted thingie soon.  Hopefully I can
report something back.

--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Jeremy Dunck


On 12/24/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:

What's the quality of the Schema Evolution code from last summer?


Not done.


Is it
at all usable?

No.


Is it fixable?

Yes.


Is anyone else worried that Google won't
be so keen to give Django coders they've spent thousands of dollars on
if their investment doesn't even make a difference in the project
because the code never ends up in there?


No.  I see lots of SoC projects stagnate, but lots more make it.  I
think SoC is a bit like YCombinator in the sense that they're
scattering peanuts to see what grows.  And it's good PR as well as a
recruiting tool.

Anyway, you seem enthusiastic.
Here's a thread showing recent progress.
http://groups-beta.google.com/group/django-users/browse_thread/thread/bd1417a08e37774a/e157ea7b4a37b556

Brother, can you lend a hand?

--~--~-~--~~~---~--~~
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: pure-HTTP deployment?

2006-12-23 Thread Chris Lee-Messer


On the topic of a pure python wsgi http server. Has anyone checked out
twisted. I seem to remember that zope actually nows uses twisted for
its server, and there is a twisted.web2.wsgi module that I've seen
mentioned elsewhere as a functional wsgi server that's being used in
production for some sites.

It might be possible to put together a functional wsgi web server quite
quickly  for django based upon this.

-chris

ps. I do not actually know very much about twisted but have had it on
my list of things to explore for a long time.


--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Todd O'Bryan


On Sun, 2006-12-24 at 11:38 +0530, Kenneth Gonsalves wrote:


On 24-Dec-06, at 8:50 AM, ringemup wrote:

> Yeah, I'm good with syncdb when adding a model, it's when I
> add/remove/change a field that problems occur.
>
> Sqlreset sounds convenient...  how do you deal, though, with
> re-inputting data for testing once you modify a model?

ready made scripts - run outside django



What's the quality of the Schema Evolution code from last summer? Is it
at all usable? Is it fixable? Is anyone else worried that Google won't
be so keen to give Django coders they've spent thousands of dollars on
if their investment doesn't even make a difference in the project
because the code never ends up in there?

Todd

--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Kenneth Gonsalves



On 24-Dec-06, at 9:01 AM, Aaron Jacobs wrote:


2. if you are not worried about data loss run sqlreset - or better,
drop the database, create it and run syncdb
3. if you alter a model, run sqlall, examine the out put to see what
statements django wants and put them in manually


These two are fine for a single developer's purposes, but what about
if you want to distribute your app to others?  You'd have to come up
with some automated process, even if it's hand-coded.


each time you change your schema, you write the appropriate sql  
script and give it to your users. This is what the django devels do  
when they make backward incompatible changes.


--

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



--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Kenneth Gonsalves



On 24-Dec-06, at 8:50 AM, ringemup wrote:


Yeah, I'm good with syncdb when adding a model, it's when I
add/remove/change a field that problems occur.

Sqlreset sounds convenient...  how do you deal, though, with
re-inputting data for testing once you modify a model?


ready made scripts - run outside django

--

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



--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Jeremy Dunck


On 12/23/06, ringemup <[EMAIL PROTECTED]> wrote:


Yeah, I'm good with syncdb when adding a model, it's when I
add/remove/change a field that problems occur.

Sqlreset sounds convenient...  how do you deal, though, with
re-inputting data for testing once you modify a model?


This is becoming a FAQ.  :)

See the email I sent (with attachment) in this thread:
http://groups-beta.google.com/group/django-users/browse_thread/thread/bd1417a08e37774a/e157ea7b4a37b556

--~--~-~--~~~---~--~~
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: Memcached Servers Failures

2006-12-23 Thread Jeremy Dunck


On 12/23/06, Osso <[EMAIL PROTECTED]> wrote:

For our website (http://www.curse-gaming.com), we are using a pool of 8
servers.
The problem is when a server goes down, or more precisely when one the
memcached instances goes down, it crashes the whole website.


Hmm, it'd be helpful to see a traceback.  Looking at the source just
now, it seems both getting and setting should be resilient to server
failure; it chains attempts on the servers based on (pseudocode):
hash(key+try) % #servers

--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Aaron Jacobs


On 12/23/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:

2. if you are not worried about data loss run sqlreset - or better,
drop the database, create it and run syncdb
3. if you alter a model, run sqlall, examine the out put to see what
statements django wants and put them in manually


These two are fine for a single developer's purposes, but what about
if you want to distribute your app to others?  You'd have to come up
with some automated process, even if it's hand-coded.

I really hope Django gets a migration feature like RoR's sometime soon.

--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread Aaron Jacobs


On 12/23/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:


Yep.  If you haven't seen it, Wikipedia has excellent coverage of
unicode, including utf-8:
http://en.wikipedia.org/wiki/Utf-8


Yeah, that's actually where I wound up reading about it.
Specifically, its property of not allowing the bytes encoding one
character to appear in the bytes for another character with a longer
byte string.


Which basically means that the character encoding used in octet
encoding for http URIs is undefined.  ...In the real world, I've only
ever seen characters encoded as utf-8 octets.


Well I tried it in Safari, Camino (and thus Firefox?), and IE 7.
That's pretty much good enough for my purposes.  Of course, it would
be better if the web framework would take the initiative and do the
Right Thing without me having to worry about it...


There's been a general consensus that unicodifying Django is a worthy
goal, and I know some work's been done on it, though I don't see a
branch for it.


Yeah, that's what I gathered and I really hope that happens.  For now,
I guess I'll have to go with this solution.

Thanks for your help.

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: Internationalization and caching not working!

2006-12-23 Thread Jeremy Dunck


On 12/23/06, Beegee <[EMAIL PROTECTED]> wrote:

But, whenever I switch between the two languages with caching enabled
the results are unpredictable. I get a Dutch page when I should get an
English one and vice versa.


The cache middleware creates it's keys based on the initial response's
vary header.
You'll need to use vary_on_headers, presumably including Content-Language.
http://www.djangoproject.com/documentation/cache/#using-vary-headers

--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread ringemup


Yeah, I'm good with syncdb when adding a model, it's when I
add/remove/change a field that problems occur.

Sqlreset sounds convenient...  how do you deal, though, with
re-inputting data for testing once you modify a model?


--~--~-~--~~~---~--~~
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: Comments framework in development?

2006-12-23 Thread ringemup


Thanks, guys -- developer list it is


--~--~-~--~~~---~--~~
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: startswith a range

2006-12-23 Thread Jeremy Dunck


On 12/23/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
...

Same result, different composition. Personally, given Guido's
predisposition to eliminating reduce() in Python 3000 [1], I'd be
avoiding using reduce in new code.



A python implementation of reduce:

NOT_GIVEN="(*piuhuI&*uyobJH!ikuoi1p9e;mks c0p[p"

def reduce_(f,s,i=NOT_GIVEN):
   it=iter(s)
   if i == NOT_GIVEN:
   try:
   result = it.next()
   except StopIteration:
   raise TypeError, "reduce() of empty sequence with no initial value"
   else:
   result = i
   for i in it:
   result = f(result,i)
   return result

--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread Jeremy Dunck


On 12/23/06, Aaron Jacobs <[EMAIL PROTECTED]> wrote:
...

after reading a bit about UTF-8, it sounds like `0x2F` is never used
in anything but the forward slash.


Yep.  If you haven't seen it, Wikipedia has excellent coverage of
unicode, including utf-8:
http://en.wikipedia.org/wiki/Utf-8

Even so, rfc 3926 (covering URIs) 1.2.1:
"
Percent-encoded
  octets (Section 2.1) may be used within a URI to represent characters
  outside the range of the US-ASCII coded character set if this
representation is allowed by the scheme or by the protocol element in
which the URI is referenced.  Such a definition should specify the
character encoding used to map those characters to octets prior to
  being percent-encoded for the URI.
"
While rfc 2616 (covering http 1.1) 3.2.3 says only:
"
  Characters other than those in the "reserved" and "unsafe" sets (see
  RFC 2396 [42]) are equivalent to their ""%" HEX HEX" encoding.
"

Which basically means that the character encoding used in octet
encoding for http URIs is undefined.  ...In the real world, I've only
ever seen characters encoded as utf-8 octets.


Now my issue switches to the analogous one for the model layer.  It
seems that SQLite, at least, works fine with the UTF-8 byte strings
Django gives it, and faithfully returns them when asked.  But again,
one has to worry about remembering to decode them into Unicode strings
when needed, which is a bit annoying.  And of course you have to
remember to make your database fields three or four times longer than
needed, since each character takes up three or four bytes.


There's been a general consensus that unicodifying Django is a worthy
goal, and I know some work's been done on it, though I don't see a
branch for it.

These tickets deal with unicode to the DB.
http://code.djangoproject.com/ticket/952
http://code.djangoproject.com/ticket/3115

--~--~-~--~~~---~--~~
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: Proposed Changes

2006-12-23 Thread Jeremy Dunck


On 12/23/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:


On 12/23/06 6:31 AM, [EMAIL PROTECTED] wrote:
> 2. content types being added to ._meta. We use them all the time and I
> don't like querying or hitting the cache just to get the "ID" of my
> model. The plan would be to have these saved at runtime and updated
> using signals

This has been discussed before; search the ticket tracker before you start on
anything.


To save time for people with better things to do, I believe this is
the ticket referenced:
http://code.djangoproject.com/ticket/1717

--~--~-~--~~~---~--~~
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: Your Approach to Schema Evolution?

2006-12-23 Thread Kenneth Gonsalves



On 21-Dec-06, at 2:14 AM, ringemup wrote:


In the meantime, I'm interested in picking up some ideas:  how do you
deal with changing database structures as you develop a Django app?


1. if you just add a new model - run syncdb and it automatically gets  
added
2. if you are not worried about data loss run sqlreset - or better,  
drop the database, create it and run syncdb
3. if you alter a model, run sqlall, examine the out put to see what  
statements django wants and put them in manually


--

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



--~--~-~--~~~---~--~~
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: Design question

2006-12-23 Thread Kenneth Gonsalves



On 21-Dec-06, at 8:50 PM, [EMAIL PROTECTED] wrote:

I have a table of Clients that just contains an client_id. I have  
three

tables for different clients (Companies, Independent and Other). Those
three have wildly different fields associated with them (ie. only one
of those types is allowed to log in). What I have done is a OneToOne
Field mapping to Clients.


though not strictly on topic, the idea of having a table with just  
the client_id does not seem to conform to sql standards. I would love  
to see your table schema if it is not confidential.


--

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



--~--~-~--~~~---~--~~
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: Comments framework in development?

2006-12-23 Thread Kenneth Gonsalves



On 21-Dec-06, at 2:09 AM, ringemup wrote:

Before I start seriously hacking the comments framework or  
implementing

a replacement, I was wondering if anyone knows if any further work is
being done on the comments framework, and if so, what's planned, or
where I could find any more info?


check the django devel list

--

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



--~--~-~--~~~---~--~~
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: Edit user info

2006-12-23 Thread [EMAIL PROTECTED]


Err.. I mean, thank, Georgi. ;)


--~--~-~--~~~---~--~~
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: Edit user info

2006-12-23 Thread [EMAIL PROTECTED]


Glisha, thanks for the reply! I tried out your suggestion to do this:

new_data2 = request.POST.copy()
new_data2['username'] = request.user.username
new_data2['password'] = request.user.password

And the result is that I get the following:

KeyError at /profile/edit/
'user'
Request Method: POST
Request URL:http://127.0.0.1:8000/profile/edit/
Exception Type: KeyError
Exception Value:'user'
Exception Location:

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/db/models/manipulators.py
in save, line 163

And am not sure what to do from there...

Also, what's the proper way to to flatten_data and save using custom
manipulators? Do I need to put in my own function for each within the
custom manipulator?


--~--~-~--~~~---~--~~
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: Comments framework in development?

2006-12-23 Thread Russell Keith-Magee


On 12/21/06, ringemup <[EMAIL PROTECTED]> wrote:


Hi folks --

Before I start seriously hacking the comments framework or implementing
a replacement, I was wondering if anyone knows if any further work is
being done on the comments framework, and if so, what's planned, or
where I could find any more info?


There might be some work on the comment views to make them use the
newforms framework, but other than that, I can't say I know of any
work that is planned.

If you have some specific ideas on how to improve the comments
package, I would suggest raising them on the django-developers mailing
list. That's the best place to get feedback on any changes you want to
make, and it is also the best place to find out if there is anyone
harboring plans for modification to the comments package.

Yours,
Russ Magee %-)

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



Internationalization and caching not working!

2006-12-23 Thread Beegee


I build a Dutch and English website: http://www.localpoint.nl. Traffic
to the website is increasing. That is why I am looking at enabling
Django caching.

However, it does not seem to work! I tried different backends. The file
backend for example does not store any files. I also tried memcached.
That seems to be working although I am not able to check the contents
of memcached itself. Is that possible?

But, whenever I switch between the two languages with caching enabled
the results are unpredictable. I get a Dutch page when I should get an
English one and vice versa.

Is there someone who has experience in setting up caching with a Django
website that uses internationalization (i18n)?

Thanks very much for your help.

By the way these are the middleware settings I am using:

# CacheMiddleware settings
#CACHE_BACKEND = "locmem:///"
#CACHE_BACKEND = "file:///var/www/MyDjango-cache/"
CACHE_BACKEND = "memcached://127.0.0.1:11211/"
CACHE_MIDDLEWARE_KEY_PREFIX = 'localpoint_'
CACHE_MIDDLEWARE_SECONDS = 60 * 5

MIDDLEWARE_CLASSES = (
#"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
"django.middleware.http.ConditionalGetMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.gzip.GZipMiddleware",
"django.contrib.csrf.middleware.CsrfMiddleware", #protection agains
cross site scripting.
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.cache.CacheMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.doc.XViewMiddleware",
)

But I also tried this one:

# CacheMiddleware settings
#CACHE_BACKEND = "locmem:///"
#CACHE_BACKEND = "file:///var/www/MyDjango-cache/"
CACHE_BACKEND = "memcached://127.0.0.1:11211/"
CACHE_MIDDLEWARE_KEY_PREFIX = 'localpoint_'
CACHE_MIDDLEWARE_SECONDS = 60 * 5

MIDDLEWARE_CLASSES = (
#"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
"django.middleware.http.ConditionalGetMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.gzip.GZipMiddleware",
"django.contrib.csrf.middleware.CsrfMiddleware", #protection agains
cross site scripting.
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.doc.XViewMiddleware",
   "django.middleware.cache.CacheMiddleware",
)

Same result.


--~--~-~--~~~---~--~~
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: Web Services in Django

2006-12-23 Thread Russell Keith-Magee


On 12/22/06, juampa <[EMAIL PROTECTED]> wrote:


Hello all:

I am trying to gather all the information I can about implementing web
services with Django (XML-RPC, SOAP, REST). Can you suggest good
sources of information/examples of implementations? What is the offical
status of WS support in Django? Thanks.


There is no specific WS support at present. Django lets you write
views that serve HTTP - if those HTTP packets happen to be in
XML-RPC/SOAP/... format, then you have an XML-RPC/SOAP/... app. Django
templates aren't HTML specific, so you can use them to help in
producing XML-RPC/SOAP/... packets.

There has been talk from time to time about the creation of some
generic views for REST-type applications; the goal here would be to
provide a generic mechanism that makes writing REST views easier. If
you have any specific suggestions, we'd be happy to hear them - but
check the archives of the django-users and django-developers list
first to see the current state of the debate.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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: Edit user info

2006-12-23 Thread Georgi Stanojevski


[EMAIL PROTECTED]   :


a bit more in the way of profile options, but I'm having trouble
getting the form to properly update the basic user info.


user_manipulator_data = User.ChangeManipulator(request.user.id)


I had a similar problem yesterday. I thought the automatic 
ChangeManipulator for User was broken. :-)


You probably didn't send the username and password with the form.

You need to pass the two required User fields username and password 
every time you update the User model or get_validation_errors() will 
return an error.


Put {{ forms.errors }} at top of your template which you use to update 
the user model to see all the errors that get_validation_errors() returns.


You could either include them in every POST with the form or put them in 
new_data2 in the view just before you validate it. Something like this:


new_data2 = request.POST.copy()
new_data2['username'] = request.user.username
new_data2['password'] = request.user.password

Or you could write a custom manipulator that unifies the fields for User 
and your user_Profile models. And only validate against it?



class MyProfileManipulator(forms.Manipulator):
def __init__(self):
self.fields = (
# custom fields from the User model
forms.TextField(field_name="first_name", ...),
forms.TextField(field_name="last_name", ...),
# fields from your custom model
forms.TextField(field_name="phone", ...),
forms.TextField(field_name="city", ...),
)

--
Glisha
The perfect OS, MS-DOS!
No patches, no root exploits for 21 years.

--~--~-~--~~~---~--~~
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: Virtualhost, Location, access to "root location"

2006-12-23 Thread Osso


On Dec 21, 7:10 am, "Hans.Rauch" <[EMAIL PROTECTED]> wrote:

If I'm using the developing server, I can access my test-object with
"http://localhost:8000/test/index.html;. If I try the same project
using apache2 virtualhost and call
"http://dms.bildung.hessen.de/test/index.html;, I'll get an empty
rRequest.META['PATH_INFO']. If I call
"http://dms.bildung.hessen.de/abc/test/index.html; - "abc" can be any
name - rRequest.META['PATH_INFO'] has the value "/test/index.html" - it
should be "/abc/test/index.html". So the first "folder" in the url
seems to be deleted!

Changing my httpd.conf to something like this


  ServerName dms.bildung.hessen.de
  
SetHandler mod_python
...

and using adresses likehttp://dms.bildung.hessen.de/dms/test/index.html; would 
work, but I
really want to use an address without "virtual location/directoty" like
"dms".

MyQuestion: How can I use apache2 virtualhosts with django, for
adresses like "http://dms.bildung.hessen.de/test/index.html;.

Hans Rauch


We are using virtual hosts like


  ServerName wow.curse-gaming.com
  SetHandler mod_python
...

and the path info is working right for us.

Maybe the problem is somewhere else in the setup?
That setup is the Apache2.2 but it was working with Apache2 before.


--~--~-~--~~~---~--~~
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: variables in Django Session

2006-12-23 Thread Osso


If you modify the variable directly it won't call the setter in the
django session app. So you need to:

# get the variable
myform = request.session['myform']
# update it
myform['field1']=someVariable
# update your session
request.session['myform'] = myform

I had the same problem and that fixed it form. If you have a solution
for skipping the 2 extra steps I would use 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
-~--~~~~--~~--~--~---



Re: Displaing Images and Static Paths

2006-12-23 Thread Osso


http://www.djangoproject.com/documentation/static_files/


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



~*~ Vista and XP and Wallpapers and Themes ~*~

2006-12-23 Thread Marry4U

  *Windows Vista & XP Themes*
*And *
*Wallpapers*

[image: Vista Theme Wallpaper]
http://windows-secrets.50webs.com/vista-theme/


Free Wallpapers
Free Themes
Free Icons
Free Plugins

and

More.. 

http://windows-secrets.50webs.com/vista-theme/

--~--~-~--~~~---~--~~
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: need some help with unordered_list

2006-12-23 Thread Osso


On Dec 23, 10:03 pm, [EMAIL PROTECTED] wrote:

Hi,

I have the following list ['item 1', 'item 2', 'item 3'] and want the following 
output:

item 1
item 2
item 3

Since this is not in the example for unordered_list I don't know how I can get 
this right.

Is it possible with unordered_list ?


I think it is faster to try out yourself than writing a post.
I don't see why it shouldn't work. {{ list| unordered_list }} in the
tempale should output a simple list of li if you don't have any sublist.


--~--~-~--~~~---~--~~
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: Proposed Changes

2006-12-23 Thread Osso



> 3. generic relations, that are useful. I dont know if they've become
> useful since before, but when I first tried them they didnt help me
> much. The idea is a you have 2 fields, such as content_type, and
> object_id, and another field called, lets say my_table_name.
> my_table_name = TrueGenericRelationThing(content_type, object_id). You
> would be able to then reference htis just like a normal ManyToMany or
> ForeignKey field.These already 
exist:http://www.djangoproject.com/documentation/models/generic_relations/

Jacob


GenericRelations as they are now do not work with select related.
Also you can't change the names of the 2 fields for the content type
and the object id.
And you can't create objects using the generic key.


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



Virtualhost, Location, access to "root location"

2006-12-23 Thread Hans.Rauch


If I'm using the developing server, I can access my test-object with
"http://localhost:8000/test/index.html;. If I try the same project
using apache2 virtualhost and call
"http://dms.bildung.hessen.de/test/index.html;, I'll get an empty
rRequest.META['PATH_INFO']. If I call
"http://dms.bildung.hessen.de/abc/test/index.html; - "abc" can be any
name - rRequest.META['PATH_INFO'] has the value "/test/index.html" - it
should be "/abc/test/index.html". So the first "folder" in the url
seems to be deleted!

Changing my httpd.conf to something like this


 ServerName dms.bildung.hessen.de
 
   SetHandler mod_python
   ...

and using adresses like
http://dms.bildung.hessen.de/dms/test/index.html; would work, but I
really want to use an address without "virtual location/directoty" like
"dms".

MyQuestion: How can I use apache2 virtualhosts with django, for
adresses like "http://dms.bildung.hessen.de/test/index.html;.

Hans Rauch


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



Virtualhost, Location, access to "root location"

2006-12-23 Thread Hans.Rauch


If I'm using the developing server, I can access my test-object with
"http://localhost:8000/test/index.html;. If I try the same project
using apache2 virtualhost and call
"http://dms.bildung.hessen.de/test/index.html;, I'll get an empty
rRequest.META['PATH_INFO']. If I call
"http://dms.bildung.hessen.de/abc/test/index.html; - "abc" can be any
name/folder - rRequest.META['PATH_INFO'] has the value
"/test/index.html" - it should be "/abc/test/index.html". So the first
"folder" in the url seems to be deleted!

Changing my httpd.conf to something like this


 ServerName dms.bildung.hessen.de
 
   SetHandler mod_python
   ...

and using adresses like
http://dms.bildung.hessen.de/dms/test/index.html; would work, but I
really want to use an address without such a "virtual
location/directoty".

MyQuestion: How can I use apache2 virtualhosts with django, for
adresses like "http://dms.bildung.hessen.de/test/index.html;.

Hans Rauch


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



pass extra_context to feeds?

2006-12-23 Thread ringemup


Hello --

When I try to pass any extra_context values to the syndication
framework, I get an error that "feed() got an unexpected keyword
argument 'extra_context'".

Is there any way to send additional variables to a feed?

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



Your Approach to Schema Evolution?

2006-12-23 Thread ringemup


Hello all --

I'm aware that there are long-term plans to provide for schema
evolution in Django (much like RoR's "Migrations".

In the meantime, I'm interested in picking up some ideas:  how do you
deal with changing database structures as you develop a Django app?


--~--~-~--~~~---~--~~
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: dynamic query key asignment

2006-12-23 Thread Jorge Gajon


Hi there k1000,

On 12/21/06, k1000 <[EMAIL PROTECTED]> wrote:

Is there any way to create dynamically key ( 'thiskey_exact' ) in query
object. eg:
 Object.objects.filter(thiskey_exact = 'something')


I'll paste here an example from one project I have here:


Actividad.objects.filter(nombre__icontains='fabri')

[]


dyn_key = '%s__icontains' % 'nombre'
kwargs = {} # a dictionary
kwargs[dyn_key] = 'fabri'  # the value to the key



kwargs

{'nombre__icontains': 'fabri'}


Actividad.objects.filter(**kwargs)

[]


Hope it helps.

Regards,
Jorge

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



need some help with unordered_list

2006-12-23 Thread dummy


Hi,

I have the following list ['item 1', 'item 2', 'item 3'] and want the following 
output:

item 1
item 2
item 3

Since this is not in the example for unordered_list I don't know how I can get this right. 


Is it possible with unordered_list ?

Regards,
Dirk
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


--~--~-~--~~~---~--~~
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 Ticket #1476: New field option: edit_external=True

2006-12-23 Thread Jim Fritchman


I am new to Django and web development for that matter but I saw ticket
#1476 posted about related objects being displaed as lists with a link
to allow the user to edit.  I would like to do something very similar
and I am hoping that someone can help me get on the right track.

I have a person class that has the possibility of having more then one
phone number and more then one address.  So I would like to create a
list of phone numbers and a list of addresses when the user is editing
the person's information.  I want the list to look very similar to what
the admin builds for their lists with a button to allow you to add a
new one.

I have read as much as I can to find a solution but I just can't seem
to grasp the best way to do this?  Do I need to build my own custom
view?  If so, how do you plug in a custom view to be used in the place
if the view that is generated?  I am really hoping that there is a way
to do this and I hope that someone can shed some light on this for me
and push me down the right path.

Thank you very much for your help.

Regards,
Jim Fritchman


--~--~-~--~~~---~--~~
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 Types and template tags...

2006-12-23 Thread Bram


Hello Everyone,


Long time Django lurker, now gone full steam from theory to practice
:-)


In the 'interest' of staying DRY, I ran into a bit of a problem today:

1. I have Favorite, which is a generic relation from anything to a User
(in my case the django.auth kind of User).

2. I have a template tag called "show_users user_list start end" which
lists a set of users, with some slicing.

Now, I have an Article which has users which favorited it. So I can say
article.fans, but sadly enough this obviously returns me a list of
generic relations, not a list of actual users, so I can't re-use the
template tag...!!

Of course I could rewrite the template for the template tag, but, I'd
be drowning, not DRY!

See below for the code..

Thanks a lot, and expect more questions from me in the near future ;-))


- bram



The models:

class Favorite(models.Model):
content_type = models.ForeignKey(ContentType) # to identify the table
object_id = models.PositiveIntegerField() # the id
content_object = models.GenericForeignKey() # the actual object
user = models.ForeignKey(User) # User who is favoritizin'
created = models.DateTimeField(auto_now=True) # Timestamp of
assignment

class Article(models.Model):
#  big snip
fans = models.GenericRelation(Favorite) # users that favorited this
song


The template tag:

@register.inclusion_tag('common/user_list.html')
def show_user_list(users, start=None, end=None):
return {'users' : users[start:end]}

The template:

{% for user in users %}
   {{ user.username }}
{% endfor %}


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



Memcached Servers Failures

2006-12-23 Thread Osso


Hello,

For our website (http://www.curse-gaming.com), we are using a pool of 8
servers.
The problem is when a server goes down, or more precisely when one the
memcached instances goes down, it crashes the whole website.

We are actually using a modified version of the tummy's python
memcached connector that sets a timeout on sockets connections so that
our website doesn't hang anymore while waiting to connect to memcached.

However I am wondering what solution did you guys use to solve that
issue? Having a caching system that relies on 8 servers or more to be
all up all time does not seem the ideal solution to me. So I guess
there is another way to change that behavior.


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



Web Services with Django.

2006-12-23 Thread juampa


Hello all:

I am trying to find as much information as possible about web services
with Django (RPC, SOAP, REST), particularly implementing (serving)
them. I have found a couple references in this list to a SOAP and an
XML-RPC patch. Is there more information or examples available? What is
the official status of WS in Django?

Thanks,

Juampa


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



Extrange behavior with get 'self' FK in admin view

2006-12-23 Thread ElGranAzul


Hi, i've and extrange behavior with admin views with the following
code:

class Subdivision(models.Model):
   code = models.CharField(_('Code'), maxlength=10, primary_key=True)
   name = models.CharField(_('Name'), maxlength=100, core=True)
   stype = models.CharField(_('Type'), maxlength=3,
choices=COUNTRY_SUBDIVISION_TYPE)
   country = models.ForeignKey(Country, verbose_name=_('Country'))
   island = models.ForeignKey(Island, verbose_name=_('Island'),
blank=True, null=True)
   parent = models.ForeignKey('self', related_name="children",
verbose_name=_('Parent Subdivision'), blank=True, null=True)
   lat = models.FloatField(_('Latitude'), max_digits=9,
decimal_places=6, blank=True, null=True)
   lon = models.FloatField(_('Longitude'), max_digits=9,
decimal_places=6, blank=True, null=True)

   def __str__(self):
   parent = self._parents_repr()
   if parent:
   return ('%s (%s of %s, %s)') % (self.name,
self.get_stype_display(), parent, self.country)
   else:
   return ('%s (%s of %s)') % (self.name,
self.get_stype_display(), self.country)
   __str__.short_description = _("Descipcion")

   def _recurse_for_parents(self, cat_obj):
   p_list = []
   if cat_obj.parent_id:
   p = cat_obj.parent
   p_list.append([p.name,p.stype])
   more = self._recurse_for_parents(p)
   p_list.extend(more)
   if cat_obj == self and p_list:
   p_list.reverse()
   return p_list

   def _parents_repr(self):
   p_list = self._recurse_for_parents(self)
   if len(p_list) >= 1:
   p = p_list.pop()
   p_list = p[0]
   else:
   p_list = ''
   return p_list

   class Meta:
   verbose_name = _('Subdivision')
   verbose_name_plural = _('Subdivisions')

   class Admin:
   list_display = ('code','name','island','__str__')
   list_filter = ['country','stype']
   search_fields = ['code','name']

The problem is that wehn i try to edit an object and call
self._parents_repr() in __str__ the admin views raise an 404 error
saying that cannot find a model with this code, but if i remove the
self._parents_repr() it works ok. In shell the str output works good,
and in admin list.

Is it an admin views error?


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



fileField pdf validation

2006-12-23 Thread rp



Does anyone have a recommended way to validate PDF files which are
being uploaded?

I only plan on uploading PDFs through the admin but wanted to know a
more robust way than simply checking the extension.

   file_reference = models.FileField(upload_to='xxdirnamexx',
blank=True,validator_list =
[filenameEndsWith(choices=FILETYPES_FOR_UPLOAD),])

I have ReportLab installed but have only used it for creating PDFs--not
opening existing ones.

Would it be worth checking the file itself?  For example, checking for
"%PDF-1" as the first characters?

Thanks for your help,

raman


--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread Aaron Jacobs


After researching it some more, it seems that Django uses UTF-8 byte
strings internally (as opposed to the actual Unicode strings that
Python supports).  So the following regular expression actually does
work:

r"^name/(?P[^/]+)/$"

What is passed in the `name` parameter is a UTF-8 byte string, so if
you need an actual Unicode string, you can do the following:

unicode_name = name.decode('utf8')

The only thing I worried about initially was the possibility of having
one of the bytes making up the Chinese character be `0x2F`, which is
the code for a forward slash.  Since the regular expression matches
against the UTF-8 byte string, it treats each byte as an independent
character and thus would treat such a byte as a forward slash.  But
after reading a bit about UTF-8, it sounds like `0x2F` is never used
in anything but the forward slash.

Now my issue switches to the analogous one for the model layer.  It
seems that SQLite, at least, works fine with the UTF-8 byte strings
Django gives it, and faithfully returns them when asked.  But again,
one has to worry about remembering to decode them into Unicode strings
when needed, which is a bit annoying.  And of course you have to
remember to make your database fields three or four times longer than
needed, since each character takes up three or four bytes.

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



ViewDoesNotExist at /admin/

2006-12-23 Thread eobanb


Hi,

I'm having a problem that I absolutely cannot figure out.  I've
double-checked and re-checked urls.py (I have the right line
uncommented), settings.py (I have the django.contrib.admin as an
installed app), restarted fcgi, everything.  I've tried the tutorial
from scratch three times now, each time rm -rfing the whole thing and
checking out the trunk from svn again after I get stuck.  I just cannot
get through the tutorial because I cannot get the admin application to
work.  This is what happens:

ViewDoesNotExist at /admin/
Tried index in module django.contrib.admin.views.main. Error was:
'module' object has no attribute 'index'

Additionally, I can't get the dev server to work either.  I've bound it
to my IP and I try to connect on :8000 and it just times out.  I don't
really care about that that much though as I have everything seemingly
set up with apache and fcgi.

--Eoban


--~--~-~--~~~---~--~~
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 hosting gets cheaper

2006-12-23 Thread Remi


Hi everyone,

I thought you might be interested in knowing that WebFaction just
upgraded their hosting plans.

We've added one long-running process and 40MB of RAM to all of our
plans.

This means that Django hosting is now available on our "Shared 1" plan,
starting at $7.50/month.

That's our little holiday present :)

We've been happily supporting Django from the start and host hundreds
(actually, close to a thousand now) of Django sites ...

Even if you don't host with us, feel free to have a look at our Django
forum where you might find useful information related to Django
hosting: http://forum.webfaction.com/viewforum.php?id=19


Happy holidays everyone.

Remi.

http://www.webfaction.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
-~--~~~~--~~--~--~---



Accessor for field 'somefield' clashes with related field ... Add a related_name argument to the definition for 'somefield'

2006-12-23 Thread [EMAIL PROTECTED]


Hi... I was wondering why when you have something like this:
class Loan(models.Model):
   loan_id = models.AutoField(primary_key=True)
   originator =models.ForeignKey(UserInfo,null=True)
   obligor = models.ForeignKey(UserInfo,null=True)

Why it gives you errors..until you change it to this:
class Loan(models.Model):
   loan_id = models.AutoField(primary_key=True)
   originator =models.ForeignKey(UserInfo,
related_name="originator",null=True)
   obligor = models.ForeignKey(UserInfo,
related_name="obligor",null=True)



Why doesn't django just just look at the name you have specified before
the equal sign..rather than making you put the same thing in a
related_name field?


--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread Aaron Jacobs


On 12/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Maybe I'm not quite sure what you're problem is :)


I want to parse a URL matching the following regular expression:

r"name/(?P[^/]+)/"

That is, a URL of the form `name/Johnson/`, where 'Johnson' gets
passed to my view.  But the catch is, I want the name to be able to be
Chinese.  So the regular expression needs to be able to match against
Unicode strings, and Django needs to treat the URL as a Unicode
string.

Or at least I think that's what needs to happen.  I'm asking for help
because I'm not sure.

--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread Aaron Jacobs


On 12/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Sorry, here: http://dpaste.com/4010/


Forgive me if I'm wrong, but it seems that that is just a function to
make Unicode strings into ASCII strings, losing data in the process.
That's not what I want; I want to support URLs with non-ASCII
characters in them.

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

2006-12-23 Thread [EMAIL PROTECTED]


Hi there, I've been trying to create a form that allows people to edit
their user information. I've created a model user_profile to give users
a bit more in the way of profile options, but I'm having trouble
getting the form to properly update the basic user info.

This is my first interaction with django. What I've got is a view that
defines a custom manipulator and then uses 2 separate manipulators to
create the form and save the data. One for the User model and one for
the user_profile model. I'm pretty sure that there must be a more
unified way of doing this, right? The user_profile model is linked to
the User model by a OnetoOne field.

Code:


try:
profile_manipulator = 
user_profile.ChangeManipulator(request.user.id)
except user_profile.DoesNotExist:
user_profile.new_profile(user_profile(), request.user)

profile_manipulator = user_profile.ChangeManipulator(request.user.id)
user_manipulator_data = User.ChangeManipulator(request.user.id)
user_manipulator = UserManipulator(request.user.id)

if request.method == 'POST':
new_data = request.POST.copy()
new_data2 = request.POST.copy()
errors = profile_manipulator.get_validation_errors(new_data)
errors2 = user_manipulator.get_validation_errors(new_data2)
if not errors:
profile_manipulator.do_html2python(new_data)
profile_manipulator.save(new_data)
user_manipulator.do_html2python(new_data2)
user_manipulator.save(new_data2, request.user.id)

# Do a post-after-redirect so that reload works, etc.
return HttpResponseRedirect("/profile/edit")
else:
errors = {}
errors2 = {}
# This makes sure the form accurately represents the fields of 
the
place.
new_data = profile_manipulator.flatten_data()
new_data2 = user_manipulator_data.flatten_data()

profile_form = forms.FormWrapper(profile_manipulator, new_data,
errors)
user_form = forms.FormWrapper(user_manipulator, new_data2, errors2)

If someone could give me some pointers, I'd really appreciate it. I've
found that the docs are far too sparse for me to be able to figure
everything out, and this is based upon stuff that I've read here and
comments to the Django docs.

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



~*~*~ New Christmas and New year Cards ~*~*~

2006-12-23 Thread SONAM

  *New Cards For Christmas *

[image: New Christmas Cards] 
http://christmas-card.50webs.com/
[image: Christmas Cards] 

*New Christmas Cards*
*Free Christmas Cards*

http://christmas-card.50webs.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
-~--~~~~--~~--~--~---

<>



Displaing Images and Static Paths

2006-12-23 Thread jason . leach


Hi:

Sorry for the lame question but this not at all obvious for a new user
to Django.

I can get my templates to display just fine, but I can't get the images
in them to appear and I don't want to write a view for all my imags.
Bahhh.

I keep images in /i/ in the template directories: like i/foo.png. But I
get 404 errors because django's dev server can find those without a
few. So how do I get my images out? I'd really like to serve them out
using the standard .

Thanks in advance.
J.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.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
-~--~~~~--~~--~--~---



Proposed Changes

2006-12-23 Thread [EMAIL PROTECTED]


Some changes I will be making to our version of django after the New
Year's. I'm interested on everyones opinions if I should make them
compatible w/ development Django and submit them.

1. 2 extra arguments on select_related: depth, the depth of related
tables it will query for; keys, a list of fields [relational keys] to
limit the joining of

2. content types being added to ._meta. We use them all the time and I
don't like querying or hitting the cache just to get the "ID" of my
model. The plan would be to have these saved at runtime and updated
using signals

3. generic relations, that are useful. I dont know if they've become
useful since before, but when I first tried them they didnt help me
much. The idea is a you have 2 fields, such as content_type, and
object_id, and another field called, lets say my_table_name.
my_table_name = TrueGenericRelationThing(content_type, object_id). You
would be able to then reference htis just like a normal ManyToMany or
ForeignKey field.

If anyone has any criticism as to why these are bad ideas, or if its
already in the works, let me know so I can save some time


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



dynamic query key asignment

2006-12-23 Thread k1000


Is there any way to create dynamically key ( 'thiskey_exact' ) in query
object. eg:
Object.objects.filter(thiskey_exact = 'something')
Thanx.


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



variables in Django Session

2006-12-23 Thread GvaderTh


Hi all. I have to 2 questions about django session. Why when I put
variable to session in my view method and get that variable from
session in others view method, that variable is list type, with index
0?
I try to put to session variable which is a dictionary of dictionary
and it won't work
e.g. request.session['myform'] = {}
request.session['myform'] ['field1']=someVariable
the dictionary 'my form' is visible only in that method, in others
method that dictionary is empy.
Any ideas?
Gregor


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



Design question

2006-12-23 Thread [EMAIL PROTECTED]


Hello,

I'm just starting with django, and so far I am very impressed. I am
familiar with Python and Postgresql though.

Here is my question:

I have a table of Clients that just contains an client_id. I have three
tables for different clients (Companies, Independent and Other). Those
three have wildly different fields associated with them (ie. only one
of those types is allowed to log in). What I have done is a OneToOne
Field mapping to Clients.

How do I enforce that every key in Clients maps to exactly one key from
those three tables? My instinct is to write a simple trigger, or
perhaps write insertion triggers on the three tables to make the Client
table transparent, or even easier define my own sequence - instead of a
table (I am not sure how best to integrate that with django though).

Is there a django friendly way of solving this problem?


--~--~-~--~~~---~--~~
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 hosting gets cheaper

2006-12-23 Thread Remi


Hi everyone,

I thought you might be interested in knowing that WebFaction just
upgraded their hosting plans.

We've added one long-running process and 40MB of RAM to all of our
plans.

This means that Django hosting is now available on our "Shared 1" plan,
starting at $7.50/month.

That's our little holiday present :)

We've been happily supporting Django from the start and host hundreds
(actually, close to a thousand now) of Django sites ...

Even if you don't host with us, feel free to have a look at our Django
forum where you might find useful information related to Django
hosting: http://forum.webfaction.com/viewforum.php?id=19

Happy holidays everyone.

Remi.

http://www.webfaction.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
-~--~~~~--~~--~--~---



Web Services in Django

2006-12-23 Thread juampa


Hello all:

I am trying to gather all the information I can about implementing web
services with Django (XML-RPC, SOAP, REST). Can you suggest good
sources of information/examples of implementations? What is the offical
status of WS support in Django? Thanks.

Juampa

P.S. I accidentally posted this topic in the Django-Developers list,
sorry.


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



File Upload issues

2006-12-23 Thread [EMAIL PROTECTED]


Hello all, I posted a while ago about some file upload issues, i
figured out how to upload a file with my custom manipulator, but now I
am running into an issue where if I do not include file in my form I
get an error message that "list indexes must be integers"
My custom manipulator is here, along with the update call.

class ParticipantManipulator(Manipulator):
   # define fields#

   fields =(
   forms.FileUploadField(field_name="photo_path",
is_required=False),
   forms.IntegerField(field_name="birthyear",
is_required=False),
   forms.TextField(field_name="gender", length=5,
is_required=False),
   forms.TextField(field_name="adventurousness", length=20,
is_required=False),
   forms.TextField(field_name="postal_code",length=15,
maxlength=15, is_required=False),
   forms.TextField(field_name="geographical_location",
length=20, is_required=False),
   forms.LargeTextField(field_name="bio", is_required=False),
   forms.LargeTextField(field_name="about_my_music",
is_required=False),

forms.TextField(field_name="how_did_you_find_goombah",length=20,
is_required=False),
   forms.LargeTextField(field_name="fav_lyric",
is_required=False),
   forms.TextField(field_name="best_song",length=20,
is_required=False),
   forms.TextField(field_name="best_album",length=20,
is_required=False),
   forms.TextField(field_name="best_band",length=20,
is_required=False),
   forms.TextField(field_name="worst_song",length=20,
is_required=False),
   forms.TextField(field_name="tags", length=25,
is_required=False),

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

   self.default = participant.__dict__

   def complete(self, request, data):
   self.participant.photo_path = data['photo_path']['filename']
   self.participant.birthyear = data['birthyear']
   self.participant.gender = data['gender']
   self.participant.adventurousness=data['adventurousness']
   self.participant.postal_code =data['postal_code']

self.participant.geographical_location=data['geographical_location']
   self.participant.bio=data['bio']
   self.participant.about_my_music=data['about_my_music']

self.participant.how_did_you_find_goombah=data['how_did_you_find_goombah']
   self.participant.fav_lyric=data['fav_lyric']
   self.participant.best_song=data['best_song']
   self.participant.best_album=data['best_album']
   self.participant.best_band=data['best_band']
   self.participant.worst_song=data['worst_song']
   self.participant.tags =data['tags']

   # call the custom save() method from the manipulator
   # image upload seperate from the data save- this can be
refractored to be more generic
   # save_FOO_file is an included method with a filefield
   if data['photo_path']['filename']:
   if data['photo_path']['content']:

self.participant.save_photo_path_file(data['photo_path']['filename'],data['photo_path']['content'])
   self.participant.save()
   else:
   self.participant.save()

def update(request,name):
   participant = get_object_or_404(Participant,
normal_nickname__exact=name)
   manipulator = ParticipantManipulator(participant)
   manipulator.process(request)

   if(manipulator.process(request)):
   return render_to_response('profiles/update.html', {'form':
manipulator.form, 'participant': participant })
   else:
   return HttpResponseRedirect("/profiles/%s" %
participant.normal_nickname)


in my form I have this:

About Me
   Bio
   {{form.bio}}
   Adventureousness: {{form.adventurousness}}
 My Pic. 

Current: {{ form.photo_path }}
Update:  {{ form.photo_path_file }}



when I render the form I do not get the current file listing... and I
cannot update the form without putting in a new file..


Any thoughts...


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



Comments framework in development?

2006-12-23 Thread ringemup


Hi folks --

Before I start seriously hacking the comments framework or implementing
a replacement, I was wondering if anyone knows if any further work is
being done on the comments framework, and if so, what's planned, or
where I could find any more info?

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: Curse launches with Django platform

2006-12-23 Thread Osso


The only consequences of losing a session for us is the user getting
delogged. So it is not a big deal.

We have set it up, so that it can save the session data in the db as
backup for when we'll need the system to be more reliable.


--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread [EMAIL PROTECTED]


Maybe I'm not quite sure what you're problem is :)

On Dec 23, 5:44 pm, "Aaron Jacobs" <[EMAIL PROTECTED]> wrote:

On 12/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> Sorry, here:http://dpaste.com/4010/Forgive me if I'm wrong, but it seems that 
that is just a function to
make Unicode strings into ASCII strings, losing data in the process.
That's not what I want; I want to support URLs with non-ASCII
characters in them.



--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread [EMAIL PROTECTED]

Sorry, here: http://dpaste.com/4010/

On Dec 23, 1:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

Maybe this will help you:

def safe_name(name = None):
if name == None:
return None
name = str2url(name)
name = sub(r"[^a-zA-Z0-9\-_\s\.]", "", name)
name = sub(r"[\s\._]", "-", name)
name = sub(r"[-]+", "-", name)
return name.strip("-").lower()

def str2url(str):
try:
str = str.encode('utf-8')
except:
pass
mfrom =
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîï"
to   = "AAECDNOOYSaaac"
mfrom +=
"ñòóôõöøùúûüýÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģ"
to   += "nooyyaaee"
mfrom +=
"ĤĥĦħĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘř"
to   += "iijjkkkllnrr"
mfrom +=
"ŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƂƃƄƅƇƈƉƊƐƑƒƓƔ"
to   += "ttwwyyyzzfbccddeffgv"
mfrom +=
"ƖƗƘƙƚƝƞƟƠƤƦƫƬƭƮƯưƱƲƳƴƵƶǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩ"
to   += "likklnnoopeyyzzaaiioouueeekk"
mfrom +=
"ǪǫǬǭǰǴǵǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȞȟȤȥȦȧȨȩ"
to   += "jggpnnaaeeoosstthhzzaaee"
mfrom +=
"ȪȫȬȭȮȯȰȱȲȳḀḁḂḃḄḅḆḇḈḉḊḋḌḍḎḏḐḑḒḓḔḕḖḗḘḙḚḛḜḝḞḟḠḡḢḣḤḥḦḧḨḩḪḫ"
to   += "yyaabbccddeeffgghh"
mfrom +=
"ḬḭḮḯḰḱḲḳḴḵḶḷḸḹḺḻḼḽḾḿṀṁṂṃṄṅṆṇṈṉṊṋṌṍṎṏṐṑṒṓṔṕṖṗṘṙṚṛṜṝṞṟ"
to   += "kkmm"
mfrom +=
"ṠṡṢṣṤṥṦṧṨṩṪṫṬṭṮṯṰṱṲṳṴṵṶṷṸṹṺṻṼṽṾṿẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕ"
to   += "ssuuwwxyzz"
mfrom +=
"ẖẗẘẙẚẛẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊị"
to   += "htwyaf"
mfrom +=
"ỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ"
to   += "uu"

for i in range(0, len(str)):
x = mfrom.find(str[i])
if x != -1:
str = str.replace(mfrom[x], to[x])
return str

On Dec 23, 7:28 am, "Aaron Jacobs" <[EMAIL PROTECTED]> wrote:

> In the interest of making 'pretty' URLs, I want my application to
> accept URLs that may potentially contain Chinese characters, and have
> those URLs parsed by URLconfs.  The [Django book] [1] says the
> following:

> > When a request comes in, Django tries to match the URLconf patterns against
> > the requested URL, as a normal Python string (not as a Unicode string).Is 
there any way to accomplish what I want?  On Trac and the mailing
> list I found some [efforts] [2] by Victor Ng to Unicode-ify things,
> but nothing seems to ever have been made of them.  The last
> modification to that ticket gives what sounds like a solution, but
> honestly I can't say that I understand exactly what it says.

> Any tips?

> Aaron

> [1]:http://www.djangobook.com/en/beta/chapter08/
> [2]:http://code.djangoproject.com/ticket/2588


--~--~-~--~~~---~--~~
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: Unicode URLs

2006-12-23 Thread [EMAIL PROTECTED]

Maybe this will help you:

def safe_name(name = None):
if name == None:
return None
name = str2url(name)
name = sub(r"[^a-zA-Z0-9\-_\s\.]", "", name)
name = sub(r"[\s\._]", "-", name)
name = sub(r"[-]+", "-", name)
return name.strip("-").lower()

def str2url(str):
try:
str = str.encode('utf-8')
except:
pass
mfrom =
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîï"
to   = "AAECDNOOYSaaac"
mfrom +=
"ñòóôõöøùúûüýÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģ"
to   += "nooyyaaee"
mfrom +=
"ĤĥĦħĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘř"
to   += "iijjkkkllnrr"
mfrom +=
"ŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƂƃƄƅƇƈƉƊƐƑƒƓƔ"
to   += "ttwwyyyzzfbccddeffgv"
mfrom +=
"ƖƗƘƙƚƝƞƟƠƤƦƫƬƭƮƯưƱƲƳƴƵƶǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩ"
to   += "likklnnoopeyyzzaaiioouueeekk"
mfrom +=
"ǪǫǬǭǰǴǵǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȞȟȤȥȦȧȨȩ"
to   += "jggpnnaaeeoosstthhzzaaee"
mfrom +=
"ȪȫȬȭȮȯȰȱȲȳḀḁḂḃḄḅḆḇḈḉḊḋḌḍḎḏḐḑḒḓḔḕḖḗḘḙḚḛḜḝḞḟḠḡḢḣḤḥḦḧḨḩḪḫ"
to   += "yyaabbccddeeffgghh"
mfrom +=
"ḬḭḮḯḰḱḲḳḴḵḶḷḸḹḺḻḼḽḾḿṀṁṂṃṄṅṆṇṈṉṊṋṌṍṎṏṐṑṒṓṔṕṖṗṘṙṚṛṜṝṞṟ"
to   += "kkmm"
mfrom +=
"ṠṡṢṣṤṥṦṧṨṩṪṫṬṭṮṯṰṱṲṳṴṵṶṷṸṹṺṻṼṽṾṿẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕ"
to   += "ssuuwwxyzz"
mfrom +=
"ẖẗẘẙẚẛẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊị"
to   += "htwyaf"
mfrom +=
"ỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ"
to   += "uu"

for i in range(0, len(str)):
x = mfrom.find(str[i])
if x != -1:
str = str.replace(mfrom[x], to[x])
return str


On Dec 23, 7:28 am, "Aaron Jacobs" <[EMAIL PROTECTED]> wrote:

In the interest of making 'pretty' URLs, I want my application to
accept URLs that may potentially contain Chinese characters, and have
those URLs parsed by URLconfs.  The [Django book] [1] says the
following:

> When a request comes in, Django tries to match the URLconf patterns against
> the requested URL, as a normal Python string (not as a Unicode string).Is 
there any way to accomplish what I want?  On Trac and the mailing
list I found some [efforts] [2] by Victor Ng to Unicode-ify things,
but nothing seems to ever have been made of them.  The last
modification to that ticket gives what sounds like a solution, but
honestly I can't say that I understand exactly what it says.

Any tips?

Aaron

[1]:http://www.djangobook.com/en/beta/chapter08/
[2]:http://code.djangoproject.com/ticket/2588


--~--~-~--~~~---~--~~
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 on SourceForge?

2006-12-23 Thread [EMAIL PROTECTED]


If you have django then maybe you will be able to run it by FastCGI.
BlueHost doesn't offer FastCGI but some users managed to make it work:
http://www.bluehostforum.com/showthread.php?t=715
other tutorial: http://forums.site5.com/showthread.php?t=10236


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