Re: unicode issues in multiple tickets (#952, #1356, #3370) and thread about Euro sign in django-users

2007-01-31 Thread Ivan Sagalaev
Michael Radziej wrote: > d) make the database wrapper accept both unicode and bytestrings in > the models, but always pass unicode strings to the database backend. > > Details: > > For #952 to work, the name of the character encoding has to be > translated from python naming conventions to these

Re: Django Builbot (was: dbsync for mysql lacks...)

2007-01-31 Thread Matthew Flanagan
On 1/31/07, Marc Fargas Esteve <[EMAIL PROTECTED]> wrote: > > Hi, > inline > > On 1/31/07, Matthew Flanagan <[EMAIL PROTECTED]> wrote: > > The Django buildbot slave is currently running inside a Solaris 10 > > zone so it is virtualized...kind of. > > > > Let me clarify that testing python 2.3 and

Re: cache.get_or_set()

2007-01-31 Thread Jeremy Bowers
James Bennett wrote: > On 1/31/07, Joseph Perla <[EMAIL PROTECTED]> wrote: > >> Along the lines of get_or_create(), does it make sense to implement a >> get_or_set() function for quick caches? >> > > I'm not sure I see the use case here; it only works when the code to > calculate the expen

Re: cache.get_or_set()

2007-01-31 Thread James Bennett
On 1/31/07, Joseph Perla <[EMAIL PROTECTED]> wrote: > Along the lines of get_or_create(), does it make sense to implement a > get_or_set() function for quick caches? I'm not sure I see the use case here; it only works when the code to calculate the expensive value can be fit into a single stateme

cache.get_or_set()

2007-01-31 Thread Joseph Perla
Along the lines of get_or_create(), does it make sense to implement a get_or_set() function for quick caches? It can be used in this way: from django.core.cache import cache ... big_list = cache.get_or_set('big_list', lambda: BigItems.objects.all(), 60 * 60) to retrieve from cache or

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Brian Beck
Rob Hudson wrote: > But it's just a model name... Django doesn't break if you have an app > with a model name of "Car", and another app with a model name of "Car". > It's pretty good at keeping the models separated by app. I took at look > at django.db.models.loading from the shell and it's keep

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Rob Hudson
> Keep in mind that django.contrib.contenttypes gets installed by > default, and is used by the comments app, the auth app, the admin app > and the generic relations framework. > > It's hard to escape it :) I quickly grepped the docs directory and it's not mentioned that you can't have a model n

Re: newforms: "forms with prefixes", nitpick

2007-01-31 Thread Honza Král
On 2/1/07, Frankie Robertson <[EMAIL PROTECTED]> wrote: > > On 29/01/07, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > > Am a latecomer to newforms, loving it. I have minor issue with the way > > prefixes are handled: > > http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/t

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread James Bennett
On 1/31/07, Brian Beck <[EMAIL PROTECTED]> wrote: > I agree; if your app isn't using the bundled ContentType, why should Django > complain if you make your own? Keep in mind that django.contrib.contenttypes gets installed by default, and is used by the comments app, the auth app, the admin app an

Re: newforms: "forms with prefixes", nitpick

2007-01-31 Thread Frankie Robertson
On 29/01/07, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > Am a latecomer to newforms, loving it. I have minor issue with the way > prefixes are handled: > http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/tests.py#L2648 > > The prefix is prepended to the form names, whic

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Brian Beck
Rob Hudson wrote: >> Django has a builtin type called "ContentType", >> http://code.djangoproject.com/browser/django/trunk/django/contrib/con... >> >> I'd just rename yours to something else and be done with it. > > As a workaround, sure. I've already worked around the issue. > > But I don't t

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Jay Parlar
On 1/31/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > > > Django has a builtin type called "ContentType", > > http://code.djangoproject.com/browser/django/trunk/django/contrib/con... > > > > I'd just rename yours to something else and be done with it. > > As a workaround, sure. I've already worked

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Marc Fargas Esteve
I don't see that as a limitation, think of it as a reserved word! you can use MyContentType. Or maybe a core-dev can think more on this and provide a better solution to allow gaving duplicate names (but I'm not sure if this problem applies to models on different apps or just on "some" models that

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Rob Hudson
> Django has a builtin type called "ContentType", > http://code.djangoproject.com/browser/django/trunk/django/contrib/con... > > I'd just rename yours to something else and be done with it. As a workaround, sure. I've already worked around the issue. But I don't think Django would want this typ

looking for a django contractor (Chicago area)

2007-01-31 Thread Kumar McMillan
Dear Djangoists, the company I work for is looking for a new contractor to work on a "phase 2" of a django app now in production. You are the captain of the ship but will be working alongside a team of pythonists and rubyists, a handful of whom will be available to conduct code reviews. _ Compa

Re: Django ORM bug when your app has a model named "ContentType"?

2007-01-31 Thread Jay Parlar
On 1/30/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > > I'm getting a weird bug here and this is what I've deduced... > > I've got a "Page" model and a "Content" model. Content has a FK to > Page. I also have a "ContentType" model and Content has a FK to > ContentType. This is where I tell it if

Re: A question related to URLConf, Reverse URL, etc...

2007-01-31 Thread [EMAIL PROTECTED]
Ah, ok.. I understand a little better now what you are trying to do. I definitely agree that a solution to this would be a useful addition; I would only advocate for considering the "request.stem" method instead. As with your patch, it is completely backwards-compatible and works with nested incl

clarification for newforms and unicode requested

2007-01-31 Thread Michael Radziej
Hi, Adrian, can you give us a bit of guidance on how to use newforms with "funky characters" and unicode, please? We're getting quite a few tickets on this, and I really don't know what the expected behaviour is and what not. Some specific questions that come to my mind: - Should you use unicod

Re: A question related to URLConf, Reverse URL, etc...

2007-01-31 Thread medhat
Well, Matt and Adrian closed the ticket with some similar argument. But I respectfuly disagree :-) In muramas example above, (r'^news/', 'myproject.apps.news.urls', {'stem':'news'}) this does not solve my problem, because in my case (assuming that this pattern is in an included urls.py) the stem

Re: unicode issues in multiple tickets (#952, #1356, #3370) and thread about Euro sign in django-users

2007-01-31 Thread Michael Radziej
Hi, A few days ago, I wrote: > I see three ways to fix the problem in #3370: > > a) newforms stops passing unicode strings to the Database API and uses > bytestrings. > > b) the database wrapper in Django sets connection.charset (but needs to > translate the charset name since the databases don

Re: A question related to URLConf, Reverse URL, etc...

2007-01-31 Thread [EMAIL PROTECTED]
I actually wrote a patch yesterday to solve the same problem, but for different reasons (and using a different method). From my perspective, the larger problem that access to the URL 'stem' can solve is to decouple apps from projects, making it much easier to write relocatable, "drop-in" applicat

Re: Django Builbot (was: dbsync for mysql lacks...)

2007-01-31 Thread Marc Fargas Esteve
Hi, inline On 1/31/07, Matthew Flanagan <[EMAIL PROTECTED]> wrote: > The Django buildbot slave is currently running inside a Solaris 10 > zone so it is virtualized...kind of. > > Let me clarify that testing python 2.3 and 2.4 would require a > separate buildbot master than pybots unless you can t

Re: Dynamic choices for newforms?

2007-01-31 Thread Honza Král
Hi, see ticket http://code.djangoproject.com/ticket/3257 it conatins a ModelChoiceField, that does a bit more - it also returns a valid object, not just the ID the ticket has been accepted I am only waiting for decision on whether to prepend an empty choice ("", "--") or any suggestion on ot