Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Development/AdvancedObjectList

Development / AdvancedObjectList

a few development notes for a "generic object list" which should make it easy to create advanced feature-rich lists - including sorting, filtering, adding/removing columns, etc.

1. basics

the generic object list should be able to list any type of model - given a queryset or other iterable object.

implementors can configure different types of columns - dynamically. users can then configure which columns they want to see and which should be used for sorting.

2. terminology

3. dynamic columns

it must be possible for users to add new columns. - for example a column displaying a given "tag category"

this means that either:

4. column configuration

the basic column types are hard coded in python code - just like newforms or models.

all "advanced object lists" and their columns need to be stateless - the user configuration (column config, sorting) is stored in the session (or similar)

an example advanced object list definition could look like:

from sphene.generic import advanced_object_list as objlist
class TaskList(objlist.AdvancedObjectList):
    summary = objlist.AttributeColumn('summary', sortcolumn = 'summary')
    status = objlist.AttributeColumn('owner')
    tagcol = TagCategoryColumn()

an example configuration might look like (this could be python or for example json which is modified by some javascript):

( "summary", "status", { 'column': 'tagcol', 'tagcategory': 'priority' }, )

the following conditions must be met:

Last Modified: 2008-04-19 23:34:27 by Herbert Poul - [ Snip Changes ] [ Wiki History ]

0 Comments

No comments yet.

Please login to create a new thread.



Powered by Sphene Community Tools