<s> import oembed <EOL> from oembed . providers import DjangoDateBasedProvider , DjangoProvider <EOL> from oembed . utils import size_to_nearest <EOL> from oembed . tests . models import Blog , Category , Rich <EOL> class BlogProvider ( DjangoDateBasedProvider ) : <EOL> resource_type = '<STR_LIT>' <EOL> class Meta : <EOL> model = Blog <EOL> named_view = '<STR_LIT>' <EOL> fields_to_match = { '<STR_LIT>' : '<STR_LIT>' } <EOL> date_field = '<STR_LIT>' <EOL> def author_name ( self , obj ) : <EOL> return obj . author <EOL> def title ( self , obj ) : <EOL> return obj . title <EOL> class CategoryProvider ( DjangoProvider ) : <EOL> resource_type = '<STR_LIT>' <EOL> class Meta : <EOL> model = Category <EOL> named_view = '<STR_LIT>' <EOL> fields_to_match = { '<STR_LIT>' : '<STR_LIT>' } <EOL> def title ( self , obj ) : <EOL> return obj . name <EOL> class RichProvider ( DjangoProvider ) : <EOL> resource_type = '<STR_LIT>' <EOL> class Meta : <EOL> model = Rich <EOL> named_view = '<STR_LIT>' <EOL> fields_to_match = { '<STR_LIT>' : '<STR_LIT>' } <EOL> def title ( self , obj ) : <EOL> return obj . name <EOL> oembed . site . register ( BlogProvider ) <EOL> oembed . site . register ( CategoryProvider ) <EOL> oembed . site . register ( RichProvider ) </s>
