﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9861	Requests make feature:  Using a subset of fields on the Model	freeren	nobody	"The classes inheritance are useful when you want to put some common information into a number of other models.


{{{
class FlatPage(models.Model):
    url = models.CharField(_('URL'), max_length=100, db_index=True)
    title = models.CharField(_('title'), max_length=200)
    content = models.TextField(_('content'), blank=True)
    enable_comments = models.BooleanField(_('enable comments'))
    template_name = models.CharField(_('template name'), max_length=70, blank=True,
        help_text=_(""Example: 'flatpages/contact_page.html'. 
If this isn't provided, the system will use 'flatpages/default.html'.""))
    registration_required = models.BooleanField(_('registration required'), help_text=_(""If this is checked, only logged-in users will be able to view the page.""))
    sites = models.ManyToManyField(Site)


class SubFlatPage(models.Model):
    url = models.CharField(_('URL'), max_length=100, db_index=True)
    title = models.CharField(_('title'), max_length=200)
    content = models.TextField(_('content'), blank=True)
    sites = models.ManyToManyField(Site)
    other = models.CharField(_('other'), max_length=200)
}}}


Using a subset of fields on the model (abstract=True OR abstract=False )
like :
[http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form]


# Use the fields attribute of the Model's inner Meta class. This attribute, if given, should be a list of field names to include in the SubModel.


# Use the exclude attribute of the Model's inner Meta class. This attribute, if given, should be a list of field names to exclude from the SubModel.


# Can append a little other fields."		closed	Database layer (models, ORM)	dev		wontfix	Using a subset of fields on the Model		Unreviewed	0	0	0	0	0	0
