maxtepkeev / architect

A set of tools which enhances ORMs written in Python with more features
Other
391 stars 57 forks source link

Lack of documentation. How to get started with Django. #16

Closed ramusus closed 8 years ago

ramusus commented 8 years ago

I just create model

@architect.install('partition', type='range', subtype='date', constraint='month', column='date_from')
class GroupUserActivity(models.Model):
    date_from = models.DateField()
    date_to = models.DateField()
    period = models.PositiveSmallIntegerField(db_index=True)

and put into the table dataset with different months in date_from column. And I don't see any difference in database comparing to using without architect.

What should I do to create triggers all other staff for handling child tables automatically

Database - Postgres 9.1, Django 1.5.4

maxtepkeev commented 8 years ago

Hi,

Are you sure you have read the docs, because it's all there, you missed several steps from the docs that is why you don't see any difference in your database structure.

Here is a summary:

1) Create a Django model and run syncdb to create the table in the database 2) Add architect.install decorator to the model 3) Run the following command export DJANGO_SETTINGS_MODULE=mysite.settings where mysite.settings is your settings module 4) Finally, run the following command architect partition --module path.to.the.model.module that will create the needed triggers in the database

That's it

ramusus commented 8 years ago

Thanks! I just figured out that.