Dereferencing One-to-Many Relationships in Templates

2009-04-10 Thread Anthony
Hello, I'm passing queryset 'S' to a template. S has several attributes, M, N and O. M has a one-to-many relationship with T. I need to display: N, O, T^1, T^2 through T^n, etc. (the T list would be a filtered subset) Can this be done via template tags? (Will I have to make custom ones?)

Re: adminsite instance and (registered) related objects question

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 21:24 -0700, patrickk wrote: > > > On Apr 11, 6:03 am, Malcolm Tredinnick > wrote: > > On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote: > > > anyone? > > > > *sigh* If somebody had an answer, they would have answered already. It's > > kind of

Re: adminsite instance and (registered) related objects question

2009-04-10 Thread patrickk
On Apr 11, 6:03 am, Malcolm Tredinnick wrote: > On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote: > > anyone? > > *sigh* If somebody had an answer, they would have answered already. It's > kind of self-fulfilling prophecy! your answer shows that it´s sometimes

Re: adminsite instance and (registered) related objects question

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote: > anyone? *sigh* If somebody had an answer, they would have answered already. It's kind of self-fulfilling prophecy! [...] > > > > is this intentional? the docs doesn´t explain this and my assumption > > is that different adminsite instances

Re: syncdb adding extra table from models

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 20:36 -0700, nixon66 wrote: > The meta option is already there. And the myproject_country table is > still created. I seem to remember there have been some problems where querying the existing tables in the database returned them with different casing of the name to what

Re: syncdb adding extra table from models

2009-04-10 Thread nixon66
The meta option is already there. And the myproject_country table is still created. On Apr 10, 4:51 pm, Ramiro Morales wrote: > On Fri, Apr 10, 2009 at 5:29 PM, nixon66 wrote: > > > I have a legacy database that I used inspectdb on to generate models. > >

Re: adminsite instance and (registered) related objects question

2009-04-10 Thread patrickk
anyone? I´m not sure whether or not to open a ticket on this issue. It could be "solved" with a better explanation in the docs. Question is: Is this a "bug" or is the documentation incomplete/ inexplicit? thanks, patrick On Apr 9, 9:50 am, patrickk wrote: > I´ve

Re: trying to use the aggregate functions

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 18:15 -0700, chris wrote: > > > On Apr 10, 6:55 pm, Malcolm Tredinnick > wrote: > > > However there could be, and likely are, many TextChar objects with the > > same edition value, so it would be ambiguous as to which particular > > object to

Re: trying to use the aggregate functions

2009-04-10 Thread chris
On Apr 10, 6:55 pm, Malcolm Tredinnick wrote: > However there could be, and likely are, many TextChar objects with the > same edition value, so it would be ambiguous as to which particular > object to return. Since there's no natural choice, there's no API to ask >

Re: Generic relations and unit tests.

2009-04-10 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 08:47 +0800, Russell Keith-Magee wrote: > On Sat, Apr 11, 2009 at 5:53 AM, Poromenos wrote: > > > > Hello, > > I created a model that has a ForeignKey to ContentType, but now I > > can't use my test fixtures, since the IDs they point to are random > >

Re: Generic relations and unit tests.

2009-04-10 Thread Russell Keith-Magee
On Sat, Apr 11, 2009 at 5:53 AM, Poromenos wrote: > > Hello, > I created a model that has a ForeignKey to ContentType, but now I > can't use my test fixtures, since the IDs they point to are random > every time the test database is created. I can't dump the contenttypes >

Re: This can't be that hard

2009-04-10 Thread Mr. T
Hi Malcolm, thanks for the reply. We have embedded systems that connect to a twisted server that updates table Foo periodically. I am trying to write an http server with Django (which has been very helpful) that allows an overview of the embedded systems status. The main view makes an ajax call

Re: Customizing admin form

2009-04-10 Thread Brian Neal
On Apr 10, 4:46 pm, Oleg Oltar wrote: > Hi! > > I have a model which contains several TextFields and CharFields. I want to > make all char fields longer and wider. How to do it? > > Thanks, > Oleg You can supply your own form that is using customized widgets to construct

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 7:52 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Fri, 2009-04-10 at 19:44 -0400, Alex Gaynor wrote: > > > > > > On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick > > wrote: > [...] > > > > Particularly with

Re: single queryset from multiple tables

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 19:44 -0400, Alex Gaynor wrote: > > > On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick > wrote: [...] > > Particularly with iterators, storing the (next head item, rest > of > iterator) pair in a heap leads to

Re: Object filtering with a GenericForeignKey field

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 16:04 -0700, M Godshall wrote: > I have two models, Comment and Project. Comments are connected to a > Project through a GenericForeignKey, and each Project is assigned to a > particular user. I'd like to retrieve the latest comments for all the > projects that a

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Fri, 2009-04-10 at 16:44 -0400, Alex Gaynor wrote: > > > > > > On Fri, Apr 10, 2009 at 4:40 PM, veearrsix > > wrote: > > > > This question seems to have been asked a few

Re: This can't be that hard

2009-04-10 Thread Malcolm Tredinnick
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 time. Read the docs about generic views, when > sets are evaluated, some old posts in this

Re: single queryset from multiple tables

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 16:44 -0400, Alex Gaynor wrote: > > > On Fri, Apr 10, 2009 at 4:40 PM, veearrsix > wrote: > > This question seems to have been asked a few times, but never > answered > fully. Not quite true. It's been answered

Re: rendering values from ManyToMany fields

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 12:16 -0700, Adam Fraser wrote: [...] > The problem I'm running into is that the value that comes into render > for the ManyToManyField is a list of the id's for the selected stains > and not the stains themselves. I assume I should be getting them > somehow through the

Re: Different admin registry behavior with mod_python versus dev server

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 12:01 -0700, Joe Sr. wrote: [...] > That's a good idea I will check on, but it wouldn't explain why it > works with the development server and not mod_python. It might well explain that. There's no guarantee about import order and certainly no guarantee that it will be the

Re: Where is dictfetchall ?

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 13:25 -0400, Alex Gaynor wrote: [...] > Take a look at the values() method on a queryset: > http://docs.djangoproject.com/en/dev/ref/models/querysets/#values-fields Since the original poster was explicitly asking about custom SQL situations, this isn't a valid solution.

Re: Where is dictfetchall ?

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 10:24 -0700, MS wrote: > Hi Malcolm! > > > > then is there any good (built-in) way > > > to write custom SQL queries wich would return dicts instead of tuples? > > > > You know the order the values will be returned in and you know the names > > of the columns. So you can

Re: Foreign Key query question

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 05:45 -0700, nikita kozlovsky wrote: > On Mar 9, 3:21 am, Malcolm Tredinnick > wrote: > > Hello, Malcolm. > > > > Again, the correct syntax would be: > > > Message.objects.filter(student__isnull=True) > > Why ORM uses LEFT OUTER JOIN on this

Object filtering with a GenericForeignKey field

2009-04-10 Thread M Godshall
I have two models, Comment and Project. Comments are connected to a Project through a GenericForeignKey, and each Project is assigned to a particular user. I'd like to retrieve the latest comments for all the projects that a particular user is assigned to, but according to the Django

Generic relations and unit tests.

2009-04-10 Thread Poromenos
Hello, I created a model that has a ForeignKey to ContentType, but now I can't use my test fixtures, since the IDs they point to are random every time the test database is created. I can't dump the contenttypes data because then I get many duplicate inserts, since Django rebuilds them every time

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-10 Thread lkcl
On Apr 10, 9:29 pm, lkcl wrote: > > We've recently done the dance through a wide range of tools and ended up > > selecting Qooxdoo (qooxdoo.org) for a variety of reasons. http://demo.qooxdoo.org/current/playground/#Calculator ok - found one that works. and,

Customizing admin form

2009-04-10 Thread Oleg Oltar
Hi! I have a model which contains several TextFields and CharFields. I want to make all char fields longer and wider. How to do it? Thanks, Oleg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

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: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-10 Thread lkcl
> We've recently done the dance through a wide range of tools and ended up > selecting Qooxdoo (qooxdoo.org) for a variety of reasons. i'd love to be able to evaluate it, but i get this: Error: unterminated string literal Source File:

blank = True and unique = True

2009-04-10 Thread CrabbyPete
I have a field for emails. I want it to be blank if nothing in there and unique if something is. I get a duplicate field error if I have to messages with blank fields. I can use null = True and it works, but django's admin blows up. I seen some stuff, but no real solution. Does anyone have a good

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-10 Thread lkcl
On Apr 8, 7:43 pm, Scott Newman wrote: > > I've been looking at a couple of RIA frameworks, namely Sproutcore and > > Cappuccino. The feel a bit too heavy for me. Sproutcore does not > > integrate well with Django > > The reason I'm posting is to ask the community if

Re: Generic relations swamp

2009-04-10 Thread zayatzz
Ok, I did some search on web and i took closer look at the errormessage. : Request information GET No GET data POST VariableValue poll-trans-content_type-object_id-0-keel u'1' poll-trans-content_type-object_id-0-id u'' poll-trans-content_type-object_id-1-keel u'2'

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-10 Thread lkcl
On Apr 8, 2:34 pm, Rob Madole wrote: > I've been looking at a couple of RIA frameworks, namely Sproutcore and > Cappuccino. The feel a bit too heavy for me. Sproutcore does not > integrate well with Django. Cappuccino uses Objective-J as the > language and I'm not

Re: syncdb adding extra table from models

2009-04-10 Thread Ramiro Morales
On Fri, Apr 10, 2009 at 5:29 PM, nixon66 wrote: > > I have a legacy database that I used inspectdb on to generate models. > Once I generated the models and cleaned them up, I ran manage.py > syncdb. Everything went fine except I have one model that it creates > another table

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 4:40 PM, veearrsix wrote: > > This question seems to have been asked a few times, but never answered > fully. > > I am looking to query more than one table, but return the results to a > template as one queryset ordered by date. > > The reason i'm

single queryset from multiple tables

2009-04-10 Thread veearrsix
This question seems to have been asked a few times, but never answered fully. I am looking to query more than one table, but return the results to a template as one queryset ordered by date. The reason i'm doing this is to create a single queryset including information from a blog table,

Re: Linking Back to Home Page from Template

2009-04-10 Thread Anthony
Thank you both! Exactly what I need, both for now and moving forward. On Apr 10, 12:59 pm, Colin Bean wrote: > Take a look at the reverse() function and the "url" template >

syncdb adding extra table from models

2009-04-10 Thread nixon66
I have a legacy database that I used inspectdb on to generate models. Once I generated the models and cleaned them up, I ran manage.py syncdb. Everything went fine except I have one model that it creates another table from with the name of the app attached to the front. So the model is called

Re: Running Django admin site using Lighttpd

2009-04-10 Thread stephendwolff
Here's a lighttpd config (just the part for a single website at fictional ip '1.2.3.4') project lives in the 'user' home folder, - _project will be your django project folder - ie the one with 'manage.py' look at the lighttpd docs for the specifics of the "main" options. email me off list if

Re: Linking Back to Home Page from Template

2009-04-10 Thread Colin Bean
Take a look at the reverse() function and the "url" template tag: http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse http://docs.djangoproject.com/en/dev/ref/templates/builtins/#url The "url" tag is what you want to generate a link in your template based on one of your URL patterns.

Re: Linking Back to Home Page from Template

2009-04-10 Thread Joe Sr.
On Apr 10, 1:50 pm, Anthony wrote: > Hi Everyone, > > This is really basic and I tried looking up this question since it > can't be a new one, but the closest thread I found was this one: > > http://groups.google.com/group/django-users/browse_thread/ >

rendering values from ManyToMany fields

2009-04-10 Thread Adam Fraser
Hello, I'm using a ManyToManyField to model a relationship where a "Project" object may have many different "Stain" objects. The code is working successfully and looks like this class Stain(models.Model): def __unicode__(self): return unicode(self.name) name =

Re: How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-10 Thread Christopher Dodd
I realized my question was just a bit off. What I really want is to create a TabularInline to edit the members relationship on the Group interface. This is what you get when you use an intermediary model, as well as the ability to edit the other members of that model. I could, of course, create

Re: Different admin registry behavior with mod_python versus dev server

2009-04-10 Thread Joe Sr.
On Apr 10, 1:27 pm, Alex Gaynor wrote: > On Fri, Apr 10, 2009 at 2:24 PM, Joe Sr. wrote: > > > I have been using this little trick to get a list of all my model > > classes that are subclasses of Component: > > > component_list = [] > > > for k in

Linking Back to Home Page from Template

2009-04-10 Thread Anthony
Hi Everyone, This is really basic and I tried looking up this question since it can't be a new one, but the closest thread I found was this one: http://groups.google.com/group/django-users/browse_thread/ thread/d2524403e13fcd22/515358199feebc68?lnk=gst=url+home +page#515358199feebc68">Home page

Re: inheritance, abstract base classes and generic foreign keys

2009-04-10 Thread herr.klein...@googlemail.com
On Apr 10, 12:10 pm, Malcolm Tredinnick wrote: > On Fri, 2009-04-10 at 02:34 -0700, herr.klein...@googlemail.com wrote: > > Thanks Malcom. > > > All right lets see if i could put my real problem simpler. Lets say > > you are the tutor of a programming course and you

Re: Different admin registry behavior with mod_python versus dev server

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 2:24 PM, Joe Sr. wrote: > > I have been using this little trick to get a list of all my model > classes that are subclasses of Component: > > component_list = [] > > for k in django.contrib.admin.site._registry: >if issubclass(k, Component): >

Different admin registry behavior with mod_python versus dev server

2009-04-10 Thread Joe Sr.
I have been using this little trick to get a list of all my model classes that are subclasses of Component: component_list = [] for k in django.contrib.admin.site._registry: if issubclass(k, Component): component_list.append(k) It works splendidly under the development server or

How to detect changes in ManyToManyField

2009-04-10 Thread M Godshall
When working with foreign keys, it's really easy to detect changes in the field by writing a custom save method. It would look something like this: def save(self, force_insert=False, force_update=False): old_user = None if Project.objects.filter(id__exact=self.id).count(): #the

Re: Modifying the User model

2009-04-10 Thread soniiic
The way I achieved this was to make my own registration form and use this: email = forms.EmailField(widget=forms.TextInput(attrs=dict (attrs_dict,maxlength=75)),label=_(u'Email address')) where attrs_dict was earlier defined as: attrs_dict = { 'class': 'required' } also, the email address

Modifying the User model

2009-04-10 Thread Davide
Hi all, we've been using the django User model from contrib.auth.models As we want to re-use as much code as possible, is there a way to edit the class properties, making the "email" field required? As a default this is not a required field. Gooogled for some answers but didn't find one, but if I

Re: Where is dictfetchall ?

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 1:24 PM, MS wrote: > > Hi Malcolm! > > > > then is there any good (built-in) way > > > to write custom SQL queries wich would return dicts instead of tuples? > > > > You know the order the values will be returned in and you know the names > > of the

Re: Where is dictfetchall ?

2009-04-10 Thread MS
Hi Malcolm! > >  then is there any good (built-in) way > > to write custom SQL queries wich would return dicts instead of tuples? > > You know the order the values will be returned in and you know the names > of the columns. So you can create an iterator that returns the > dictionary results: >

Re: Generating USER documentation?

2009-04-10 Thread Baxter
> On 10 Apr., 16:28, "bax...@gretschpages.com" > wrote: > > > What I'm after is documentation for the admin users, similar to the > > generated documentation, only less technical. A simple how-to for > > people who just want to know how to do things in the admin, but don't

Re: Generating USER documentation?

2009-04-10 Thread patrickk
something like this is included with grappelli, see http://code.google.com/p/django-grappelli/ patrick On 10 Apr., 16:28, "bax...@gretschpages.com" wrote: > What I'm after is documentation for the admin users, similar to the > generated documentation, only less

Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-04-10 Thread Konrad Martin
Hi cgarvey On 10 Apr., 15:25, cgarvey wrote: > It (migrating Django to appEngine via appEnginePatch) required changes to the > models, You are right, model changes are unevitable when migrating from a relational database, MySQL for example to Google's big table. Google

Generating USER documentation?

2009-04-10 Thread bax...@gretschpages.com
What I'm after is documentation for the admin users, similar to the generated documentation, only less technical. A simple how-to for people who just want to know how to do things in the admin, but don't care about views, models and template tags. Is there an easy way to create/generate such a

Re: Help! PNG file upload error...

2009-04-10 Thread Brian Neal
On Apr 9, 12:45 am, higer wrote: > When I upload a PNG file and use PIL to handle it,there will be an > error occured: > 'NoneType' object is unsubscriptable > > I do not know why and other formats(BMP GIF JPG JPEG) are all ok. I don't know if this is your problem, but

Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-04-10 Thread cgarvey
On Apr 10, 11:33 am, Konrad Martin wrote: > there is the appEnginePatch project too. Dedicated to deploy existing > Django on > appEngine.http://code.google.com/p/app-engine-patch/wiki/Documentation Thanks Konrad, I came across that afterwards, and had a quick look. It

Re: Foreign Key query question

2009-04-10 Thread nikita kozlovsky
On Mar 9, 3:21 am, Malcolm Tredinnick wrote: Hello, Malcolm. > > Again, the correct syntax would be: > > Message.objects.filter(student__isnull=True) Why ORM uses LEFT OUTER JOIN on this query ? Why not "... WHERE student_id IS NULL" ?

Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-04-10 Thread Konrad Martin
Hi cgarvey there is the appEnginePatch project too. Dedicated to deploy existing Django on appEngine. http://code.google.com/p/app-engine-patch/wiki/Documentation It has got a ready made app-engine-patch sample. Download

Re: Running django on a web hosting account

2009-04-10 Thread Konrad Martin
Hi Sergio > - Google App Engine[1] - you will need adapt somethings in your code. There is the project appEnginePatch to deploy django on Google appEngine out of the box. http://code.google.com/p/app-engine-patch/wiki/Documentation The app-engine-patch has got a ready made sample. Download

Re: How best to deal with non-abstract model inheritance in the admin

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 05:41 -0700, AndyB wrote: > Hi, > > I've got a model called Courses and a model that inherits from it > called SpecialCourses that has some extra fields. > > It seems that any SpecialCourses I add also show up in the changelist > for Courses which will be confusing for

Re: ForeignKey to a Base Model and Relationships with the Inherited Models

2009-04-10 Thread cfiles
On Apr 8, 8:59 pm, Malcolm Tredinnick wrote: > (1) Reflect the requirement in the data modelling. Particularly useful > if it's going to be a firm requirement, always. The way to provide > relations between a model and multiple other models is to use the >

How best to deal with non-abstract model inheritance in the admin

2009-04-10 Thread AndyB
Hi, I've got a model called Courses and a model that inherits from it called SpecialCourses that has some extra fields. It seems that any SpecialCourses I add also show up in the changelist for Courses which will be confusing for content editors ("remember to edit them under SpecialCourses or

Re: Strange FileField behaviour

2009-04-10 Thread John Baker
Thanks mucho Malcolm. It seems I did forget to set the form encoding in the one template but not the others! > The usual reason files aren't uploaded is because you forget to specify > the enctype attribute as a multipart/form-data encoding. >

Re: Where is dictfetchall ?

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 04:50 -0700, MS wrote: [...] > If it's not available any longer Which it isn't. > then is there any good (built-in) way > to write custom SQL queries wich would return dicts instead of tuples? You know the order the values will be returned in and you know the names of

Re: Strange FileField behaviour

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 04:41 -0700, John Baker wrote: > I have a form that validates the size of a file and it works in one > page but not another. This is very strange. The only difference > between the two templates is that the working one has only a single > form (below) and the non-working one

Where is dictfetchall ?

2009-04-10 Thread MS
Hi All, Who dumped dictfetchall from Django? I can see it used to be there, but I can't find it in 1.0. http://code.djangoproject.com/ticket/2662 http://blog.doughellmann.com/2007/12/using-raw-sql-in-django.html If it's not available any longer then is there any good (built-in) way to write

Strange FileField behaviour

2009-04-10 Thread John Baker
I have a form that validates the size of a file and it works in one page but not another. This is very strange. The only difference between the two templates is that the working one has only a single form (below) and the non-working one has 3 forms (including the form below). For some reason, in

Re: Generic relations swamp

2009-04-10 Thread zayatzz
does anyone know how to solve this problem? Alan On 9 apr, 21:54, zayatzz wrote: > Thanks. > > That worked for enabling translations for poll names - i had to insert > 'from django.contrib.contenttypes import generic', right? > It worked, but it raised few more

Re: Problem setting up Admin site per chapter 6

2009-04-10 Thread Patrick Kennedy
Yes, thanks a lot. I got it working! :) Patrick Website: www.pknews.org On Wed, Apr 8, 2009 at 9:24 PM, Xpineapple wrote: > > > Per manual ( www.djangobook.com/en/2.0/ ), Chapter 6, I try to setup > the admin site.  My version of Django is (1, 0, 2, 'final', 0) which >

Re: Help! PNG file upload error...

2009-04-10 Thread higer
I want to get a thumbnail version of the uploaded image,so I have to use PIL to handle it. But I do not know why that error occured. We can know that the chafferer is either the Django or the PIL. Then I wrote a .py script to handle images of different format ,all goes well.The operations are the

Re: inheritance, abstract base classes and generic foreign keys

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 02:34 -0700, herr.klein...@googlemail.com wrote: > Thanks Malcom. > > All right lets see if i could put my real problem simpler. Lets say > you are the tutor of a programming course and you want to check the > programming assignments semi-automatically. > So you would set

Re: trying to use the aggregate functions

2009-04-10 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 02:05 -0700, chris wrote: > Hi there, > > Here I am trying to use the aggregate functions available in SVN trunk > (I am not sure if they have been released). The following is a > simplified version of the models involved: > > class Edition(models.Model): > edkey =

Re: inheritance, abstract base classes and generic foreign keys

2009-04-10 Thread herr.klein...@googlemail.com
Thanks Malcom. All right lets see if i could put my real problem simpler. Lets say you are the tutor of a programming course and you want to check the programming assignments semi-automatically. So you would set up a Task to which a student can submit a solution. If the solution is accepted

Re: trying to use the aggregate functions

2009-04-10 Thread James Bennett
On Fri, Apr 10, 2009 at 4:05 AM, chris wrote: > So I want to find out how many characters do occur in which edition > and I get the result as expected.  However, instead of the edition > objects, what I get back are the pk values of the edition. This is expected behavior;

Re: registration and profile must save at a time

2009-04-10 Thread Praveen
Thanks and i tried to do in same fashion as Bennett suggested but getting errror def register_handle_form(request, redirect=None): print "I am in handle form" form_class = utils.get_profile_form() if request.method == 'POST': print "i am in profile post" profileform

Re: add 'link' to admin interface of model

2009-04-10 Thread ramu...@gmail.com
If I understand correctly the same problem solve by this code: def colored_name(self): return '%s %s' % (self.color_code, self.first_name, self.last_name) colored_name.allow_tags = True manual http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display On Apr 9, 8:31 pm,

Problem with request.session.set_expiry(0)

2009-04-10 Thread Rama Vadakattu
hi, 1) I have done request.session.set_expiry(0) which means user session should expire when he closes the browser. But it is not happening i have tested it several times? Any hint on what can be wrong? HOw did it test? --- By closing browser and opening

trying to use the aggregate functions

2009-04-10 Thread chris
Hi there, Here I am trying to use the aggregate functions available in SVN trunk (I am not sure if they have been released). The following is a simplified version of the models involved: class Edition(models.Model): edkey = models.TextField() class TextChar(models.Model): edition =

Re: Flup question

2009-04-10 Thread mysticalfirebird
Thanks this is my misunderstanding,I had consider flup can be a webserver and other webserver can call it. l`ll try to setup lighttpd or cherokee. thanks again --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Flup question

2009-04-10 Thread Alex Koshelev
Flup is just a proxy library between your Django project and web-server. It is communicating with web-server through FastCGI protocol. So you cannot just start FastCGI daemon and visit you project with browser. To work properly you must set up your web-server's FastCGI capabilities and direct it