<s> import re <EOL> from simpleapi import Namespace , Feature , serialize <EOL> from models import Contact <EOL> class ContactAPI ( Namespace ) : <EOL> def get ( self , id ) : <EOL> return Contact . objects . get ( id = id ) <EOL> get . constraints = { '<STR_LIT:id>' : int } <EOL> get . published = True <EOL> def post ( self , name , phone = None , fax = None ) : <EOL> return Contact . objects . create ( <EOL> name = name , <EOL> phone = phone , <EOL> fax = fax <EOL> ) <EOL> post . published = True </s>
