Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
Hello, I'm surprised this is marked as a "do not fix" bug. I mean, essentially these Q objects will at the end of the day define sets of objects, and it doesn't seem expected behavior to me to say a OR b is a subset of b. Currently I am working around this by explicitly taking IDs, and doing ors

Re: Q Object Oddity

2007-02-03 Thread [EMAIL PROTECTED]
Hi, On 4 Lut, 00:46, "Mike Axiak" <[EMAIL PROTECTED]> wrote: > y = Q(satprepreginfo__program = program) > > z = Q(registrationprofile__program = program) & \ >Q(registrationprofile__student_info__isnull = False) > > This is my result: > > In [27]: User.objects.filter(y |

Re: Q Object Oddity

2007-02-03 Thread Russell Keith-Magee
On 2/4/07, Mike Axiak <[EMAIL PROTECTED]> wrote: > > Below is the SQL the query, > User.objects.filter(y|z).distinct().count(), > generates. > > It seems to do the correct OR for the where clauses, and yet still > uses an INNER JOIN when that type of join is inappropriate for this > particular

Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
Below is the SQL the query, User.objects.filter(y|z).distinct().count(), generates. It seems to do the correct OR for the where clauses, and yet still uses an INNER JOIN when that type of join is inappropriate for this particular query. Is this a known problem? Did I write the queries

Re: Reverse query name for field 'foo' clashes with field 'Foo.bar', why?

2007-02-03 Thread Russell Keith-Magee
On 2/4/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > > Now the question :): Why does Django model validation reports name clash > errors and suggests to use related_name when clearly there are not > such clashes?: I can't see any immediately obvious reason - looks like you may have found a

Q Object Oddity

2007-02-03 Thread Mike Axiak
Hey, I'm using Django release (currently 0.95.0, waiting for etch to move to 0.95.1) with some patches (lazyuser patch comes to mind) on an internal development. The question is, I was trying to do some Q object combinations and was met with some weird results: y = Q(satprepreginfo__program =

Required edit_in_line object and filter by a joined column

2007-02-03 Thread Michel Thadeu Sabchuk
Hi guys! I have a project to publish accounting offices on the internet. All the accounting offices will have usefull tools avaiable on a centralized page and each office will have a specific homepage built from database information. My simplified model structure is: class Office(Model):

Reverse query name for field 'foo' clashes with field 'Foo.bar', why?

2007-02-03 Thread Ramiro Morales
Hi, (I'm trying to create test cases for ticket #2536 and this is something I hadn't noted until now): Say I have a models.py file almost identical to the modeltest/example #24: from django.db import models class Parent( models.Model ): name = models.CharField(maxlength=100) child =

Re: Persistent Python objects

2007-02-03 Thread Baczek
On 3 Lut, 20:58, "Tom" <[EMAIL PROTECTED]> wrote: > What do you suggest for this? If it needs to be a singleton, you could consider deploying under FastCGI, I believe the process is started only once and the real server acts simply as a proxy. But note that I _believe_, not know :)

Re: Persistent Python objects

2007-02-03 Thread Jeremy Dunck
On 2/3/07, Tom <[EMAIL PROTECTED]> wrote: > > What do you suggest for this? > Is there a single shared state among all players, or is it per player? If the former, you must already have some way of managing concurrency, no? In any case, it sounds like maybe you want a

Re: create a model instance from dictionnary

2007-02-03 Thread Sebastien Armand [Pink]
Thanks a lot, I haven't practice Python for a while, forgot lots of things... 2007/2/3, Leo Soto M. <[EMAIL PROTECTED]>: > > > On 2/2/07, Sebastien Armand [Pink] <[EMAIL PROTECTED]> wrote: > > Is it possible to instantiate a model class from a dictionnary? > > > > I mean instead of using: > > > >

Persistent Python objects

2007-02-03 Thread Tom
I have a web app which currently runs off Python's BaseHTTPServer. I want to deploy it under Django instead. It contains a Python object (the state of play of a board game) which lives in the process running the server. If I deploy under Django I'll need some way of keeping the object around

Re: full content feeds

2007-02-03 Thread James Tauber
Actually, it looks like Atom1Feed is where the restriction is. Anyone have a replacement for Atom1Feed that does full-content? Otherwise, I'll write one and contribute it (I'm working on Django support for the Atom Publishing Protocol, anyway) James On 03/02/2007, at 2:39 PM, James Tauber

Re: full content feeds

2007-02-03 Thread James Tauber
But the description template seems to just control the content of the summary element in Atom. If I want a full content feed, rather than just a summary, it looks like I can't use django.contrib.syndication.views.feed On 03/02/2007, at 4:47 AM, aaloy wrote: > 2007/2/3, James Tauber <[EMAIL

Re: haw access to values from field with choices

2007-02-03 Thread Nebojša Đorđević
On Feb 2, 2007, at 14:51 , kamil wrote: > Surely it's solved but I can't find any info about it. I'm sure that > everybody met this problem. > What is the best way to get rendered the value from the field with > choices. > Generic views spits key not value. .get__display() -- Nebojša Đorđević

Re: name 'current_datetime' is not defined

2007-02-03 Thread Mike Spradling
I figured it out, I left off from mysite.views import current_datetime On Feb 3, 8:50 am, "gordyt" <[EMAIL PROTECTED]> wrote: > Howdy Mike, > > > def current_datetime(request): > > now = datetime.datetime.now() > > html = "It is now %s." % now > > return

Re: Where to put function to instantiate and save a model object?

2007-02-03 Thread Rob Hudson
Russell Keith-Magee wrote: > Look in django.contrib.auth.models for UserManager for implementation details. Nice. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: messages, filters and templates o my!

2007-02-03 Thread Milan Andric
Cool, so you write a view that returns what, json, html? Do you recommend any specific library or possibly have an example? Since I've never done it, I'm wondering where all the pieces fit in the django layout. I'll search the ML for tips. Thanks. On Feb 3, 6:11 am, "[EMAIL PROTECTED]"

Re: javascript and form fields

2007-02-03 Thread [EMAIL PROTECTED]
Hello :) > It's 2007. There's better ways of doing these things than littering > your html with event handlers. The way of using of such thing was: ... form.field_name js_fct_string ... js_fct_handler could be something like this: "onclick=some_js_fct(this)" To achieve something like this i

Re: messages, filters and templates o my!

2007-02-03 Thread [EMAIL PROTECTED]
When I'm doing something like that, I use ajax to do the server side stuff and return the message without ever leaving the page. On Feb 2, 7:39 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > Hello, > > I have a small problem, I'm submitting a review form (form x) on a > page that has many of

Re: name 'current_datetime' is not defined

2007-02-03 Thread gordyt
Howdy Mike, > def current_datetime(request): > now = datetime.datetime.now() > html = "It is now %s." % now > return HttpResponse(html) > > - then edit your urls.py to contain > > from django.conf.urls.defaults import * > > urlpatterns = patterns('', >

Re: full content feeds

2007-02-03 Thread aaloy
2007/2/3, James Tauber <[EMAIL PROTECTED]>: > > However, I'd like my feed to be full content. Given what I have > below, what's the most straightforward way to make my feed full content? The full content would depend on your template. That is, you can make your template to present full content,

name 'current_datetime' is not defined

2007-02-03 Thread Mike Spradling
I'm baffled. I'm just getting started with django and am reading the 'Django Book'. In chapter 3 I'm told, - Make a file called views.py that contains: from django.http import HttpResponse import datetime def current_datetime(request): now = datetime.datetime.now() html = "It