a129443384 / django-grid

Lightweight grid for django (with sorting and pagination)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sphinx documentation.
=====================
If was lucky enough to succesfully build gh-pages branch, you could try to view the documentation here: http://toudi.github.com/django-grid

Quick and dirty tutorial
========================
This is a very quick info on how to use django-grid. I'll try to supply more documentation later.

First, you need to add 'grid' to your INSTALLED_APPS:

INSTALLED_APPS = (
 ...,
 'grid',
)

create a Model:

from django.db import models

class MyModel(models.Model):
  column = models.CharField("Column description", max_length = 255)
  
then, you need to create a grid based on a model:

from grid import Grid

class MyModelGrid(Grid):
 class Meta:
  model = MyModel
  
and last but not least - create a view which would display the grid:

def view(request):
 grid = MyModelGrid(request)
 return render_to_response(
  "grid/object_list.html",
  {
   "grid": grid,
  },
  context_instance = RequestContext(request)
 )
 

About

Lightweight grid for django (with sorting and pagination)


Languages

Language:Python 51.3%Language:HTML 48.7%