Custom Author Model Guide — Django Stories 1.0 documentation

Django Stories 1.0 documentation

# Custom Author Model Guide

- Table of Contents
- index
  modules
  next
  previous

# Custom Author Model Guide

By default the `authors` of a story is a many to many field using `auth.User` as the model. However you can also specify your own custom author model to be used. There are some things you will need to know about change the author model.

1. The initial migration using `South` was changed to allow for this custom many to many field be possible.

2. If your intent is to use a custom model, but have yet to defined this model, your inital migration uses `auth.User` as the authors many to many model. Later, when your custom author model is created, you will have to determine your self if the database table that was created needs to be changed as well.

This is usually the case if your custom model is named anything other the `User`. For example, the table name created using `auth.User` would be stories_storyauthor with 2 fields user_id and story_id. While story_id is obvious, user_id is the field that may change depending on the model name. The example app that is part of `stories` defines a authors model named `BasicAuthor`. The table name is still stories_storyauthor, however, the columnes it needs are basicauthor_id and story_id.

The initial `South` migration, takes this in account and will supply the name of the custom field for you. However if you changed the `authors` many to many model after the migration, you will need to determine the new column names and manually adjust them as needed.