-
Notifications
You must be signed in to change notification settings - Fork 16
Home
simone edited this page Jun 30, 2012
·
17 revisions
- Use Django with embedded database that have composite multicolumn primary key and multiple foreignkeys
- Low coupling with this specific API
from compositekey import db
class Blog(models.Model):
id = db.MultiFieldPK("title", "author")
title = models.CharField(max_length=100)
author = models.CharField(max_length=100)
class Post(models.Model):
title = models.CharField(max_length=100)
a_blog = models.ForeignKey(Blog)
the_blog = models.OneToOneField(Blog)
blogs = models.ManyToManyField(Blog)
Post.objects.get(a_blog=Blog.objects.get(title='a', author='b'))
Post.objects.get(a_blog_title='a', a_blog_author='b')
- Django Query API (filters and exclude)
- Standard ForeignKey API (OneToOne and ManyToMany)
- Automatical Related Objects
- Forms integration
- Admin (no admin patch required)
- Generation of the schema -> (Primary Key and Constraints)
- Django 1.4-beta or Trunk
- fix date rappresentation if aggregation pk
- SQLITE OK
- ORACLE XE 11 OK
- POSTGRES 9.1 OK
- MYSQL 9.1 OK
- DB2 [sorry, is not supported]
- Command inspectdb