Using composition for building database models

2008-12-10 Thread Mr. T
As I am a noob this is very possibly a stupid question Basically I would like to be able to use composition to build some of my models without having separate tables being created. class baseClass: field1 class foo(models.Model): my_base = baseClass() class bar(models

Re: Using composition for building database models

2008-12-10 Thread Mr. T
On Dec 10, 11:04 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 1:51 PM, Mr. T <[EMAIL PROTECTED]> wrote: > > > As I am a noob this is very possibly a stupid question > > > Basically I would like to be able to use composi

output of XML serializer

2008-12-18 Thread Mr. T
response = serializers.serialize('xml', MySet.objects.all()) return HttpResponse(response , mimetype='text/xml;') The output has each member of "MySet" with an tag, and then within the object, a bunch of tags with each field. It seems sort of hard to parse this on the client side. Can anyone h

nOOb alert, accessing set variables in template

2008-10-17 Thread Mr. T
Just start with Django and liking it a lot. Made a database and a page that displays queries as html table. It was all too easy. In one of my models I use a Foreign key to ref another object. class A: class B: a = ForeignKey(A) When I include A in the context of my template, I see

Re: django admin delete oneToOneField ?

2009-06-24 Thread Mr. T
I saw this in the docs: "When Django deletes an object, it emulates the behavior of the SQL constraint ON DELETE CASCADE -- in other words, any objects which had foreign keys pointing at the object to be deleted will be deleted along with it." So it sounds like you don't need to do anything. On

How to configure LOGIN_URL

2009-07-08 Thread Mr. T
In the tutorial it is simply '/accounts/login' This worked fine until I switched to a production apache server. My login_required decorators were broken because the path is absolute, login_required doesn't use the apache prefix. What to do? --~--~-~--~~~---~--~~ Y

This can't be that hard

2009-04-10 Thread Mr. T
Sorry, a QuerySet eval question. Yeah, I'm dumb I know. My view is creating a query set, XXX.objects.all(). Stale data is being served up all the time. Read the docs about generic views, when sets are evaluated, some old posts in this group. Tried ._clone(), tried iteration, tried len(), nothing

Re: This can't be that hard

2009-04-10 Thread Mr. T
overlooked. On Apr 10, 4:43 pm, Malcolm Tredinnick wrote: > On Fri, 2009-04-10 at 14:46 -0700, Mr. T wrote: > > Sorry, a QuerySet eval question. Yeah, I'm dumb I know. > > > My view is creating a query set, XXX.objects.all(). Stale data is > > being served up all the t

connection closing prematurely on logout

2009-05-08 Thread Mr. T
We've had something up and running for a while (but still developing). Something that's been working is now broken somehow: when another server logs out they report the connection was closed before they get a final msg from our server. My logout is pretty trivial def logoff(request): logout(

has date template filter been fixed?

2009-05-14 Thread Mr. T
Pretty big WTF moment for me to debug what went wrong, eventually discovering DJango's |date:"U" tempate filter is nonsense. It renders to bogus values. Eventually found this: http://tinyurl.com/rbop9g Using 1.0. Has this been fixed? --~--~-~--~~~---~--~~ You rece

Re: has date template filter been fixed?

2009-05-14 Thread Mr. T
Thanks! On May 14, 1:28 pm, Alex Gaynor wrote: > On Thu, May 14, 2009 at 3:20 PM, Mr. T wrote: > > > Pretty big WTF moment for me to debug what went wrong, eventually > > discovering DJango's |date:"U" tempate filter is nonsense. It renders > > to bogus v

Union query and/or query from multiple tables

2008-01-09 Thread Mr T
I am a newbie at this Django development environment and my Python is not as good as I would like it but I am still in the early stages of learning, so any help is appreciated. I have stumbled over a block which I can't yet get over so if anyone can help I thank you in advance. I need to display

Saving Posted form data to database

2008-03-25 Thread Mr T
I am having a bit of trouble posting checked items from a form to my view so I can save it to a database table. The data in the form are information that has been stripped from a file so there is no database link/referencing there. What I have done half works as it does post my selected items and