Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krishraghuram committed Dec 11, 2017
1 parent 859641a commit b54b501
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,20 @@ Declaring fields
It is possible to override a resource field to change some of its
options::

from import_export import fields
from import_export.fields import Field

class BookResource(resources.ModelResource):
published = fields.Field(column_name='published_date')
published = Field(column_name='published_date')

class Meta:
model = Book

Other fields that don't exist in the target model may be added::

from import_export import fields
from import_export.fields import Field

class BookResource(resources.ModelResource):
myfield = fields.Field(column_name='myfield')
myfield = Field(column_name='myfield')

class Meta:
model = Book
Expand All @@ -176,10 +176,10 @@ Not all data can be easily extracted from an object/model attribute.
In order to turn complicated data model into a (generally simpler) processed
data structure, ``dehydrate_<fieldname>`` method should be defined::

from import_export import fields
from import_export.fields import Field

class BookResource(resources.ModelResource):
full_title = fields.Field()
full_title = Field()

class Meta:
model = Book
Expand Down

0 comments on commit b54b501

Please sign in to comment.