Q:

Best way to make an article model on Django?

I'm making a site and I would like to be able to change the content from the Django's administration. What would be the best way in making something like a model called an Article and it has a title and content. I need to know how I would be able to choose a position for the article. Would the best way be something such as a CharField named for example home_main and just add those in the template. Or is there a better way to do this?

A:

I would add a CharField with choices to the Article model. I can image there will only be a set of fixed choices where an article can be positioned.
POSITION_CHOICES = (
    HOME_MAIN, "HOME_MAIN",
    BUTTOM_MAIN, "BOTTOM_MAIN",
    TOP_MAIN, "TOP_MAIN"
)

class Article(models.Model):
    position = models.CharField(max_lenght=50, choices=POSITION_CHOICES)

https://docs.djangoproject.com/en/dev/ref/models/fields/

