Updating docs

master
Manuel Francisco Naranjo 2015-07-27 16:59:55 -03:00
parent c96c6c03bb
commit ca40ec0b43
1 changed files with 3 additions and 3 deletions

View File

@ -15,20 +15,20 @@ So far only MySQL is supported as backend, but more could be added if necessary.
) )
``` ```
2. In your models.py create classes which extend dbview.models.DbView 2. In your models.py create classes which extend dbview.models.View
like this: like this:
```python ```python
from django.db import models from django.db import models
from dbview.models import DbView from dbview.models import View
class ModelA(models.Model): class ModelA(models.Model):
fielda = models.CharField() fielda = models.CharField()
fieldc = models.IntegerField() fieldc = models.IntegerField()
class MyView(DbView): class MyView(View):
fieldA = models.OneToOneField(ModelA, primary_key=True, fieldA = models.OneToOneField(ModelA, primary_key=True,
db_column='fielda__id') db_column='fielda__id')
fieldB = models.IntegerField(blank=True, null=True, db_column='fieldb') fieldB = models.IntegerField(blank=True, null=True, db_column='fieldb')