Package: armstrong.apps.related_content
Provides mechanism for relating content to other modelsYou can usearmstrong.apps.related_contentto link two separate models
together through aGenericForeignKeyfor thesourceand thedestination.  You can further organize the relationship withRelatedType(think: “articles”, “images”, “external_links”, and so on) and
all relationships are ordered.UsageYou donothave to change your models to utilize related content—it exists
outside of your model.  There are two fields that you can add that give you
easy access to your related content:armstrong.apps.related_content.fields.RelatedObjectsFieldarmstrong.apps.related_content.fields.ReverseRelatedObjectsFieldThe first let’s you access objects where your model is thesource, the
latter lets you access objects where your model is thedestination.  Note
that these return theactualmodels that are related, not theRelatedContentmodel.  If you need access to the rawRelatedContentmodel directly from your model, seearmstrong.apps.related_content.fields.RelatedContentField.You can also use theRelatedContentInlinefor exposing an admin interface
to your related content inside Django’s admin.Accessing Related ContentYou can access fields through theRelatedObjectsFieldorReverseRelatedObjectsFieldby callingall()orby_type("some_type").  These return QuerySet-like objects, but since they
are generic relationships, they’re not quite QuerySets.Inside templates, you can access related content by type using the dot-syntax.
For example, you could load the first related content of a type"articles"with this syntax:{{ my_article.related.articles.0 }}Installation & ConfigurationYou can install the latest release ofarmstrong.apps.related_contentusingpip:pip install armstrong.apps.related_contentMake sure to addarmstrong.apps.related_contentto yourINSTALLED_APPS.
You can add this however you like.  This works as a copy-and-paste solution:INSTALLED_APPS += ["armstrong.apps.related_content", ]Once installed, you have to run eithersyncdb, ormigrateif you are
usingSouth.Backwards Incompatible ChangesVersion 2.0RelatedObjectsFieldno longer extendsgenericm2m.models.RelatedObjectsDescriptor.All fields have been been moved into thefieldsmodule now.ContributingCreate something awesome – make the code better, add some functionality,
whatever (this is the hardest part).Fork itCreate a topic branch to house your changesGet all of your commits in the new topic branchSubmit apull requestState of ProjectArmstrong is an open-source news platform that is freely available to any
organization.  It is the result of a collaboration between theTexas TribuneandBay Citizen, and a grant from theJohn S. and James L. Knight
Foundation.To follow development, be sure to join theGoogle Group.armstrong.apps.related_contentis part of theArmstrongproject.  You’re
probably looking for that.LicenseCopyright 2011-2012 Bay Citizen and Texas TribuneLicensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.