old_contents: from tastypie.resources import ModelResource
  from tastypie.api import Api
  from tastypie import fields
  from models import Entry, Comment
  
  
  class EntryResource(ModelResource):
  
      class Meta:
          queryset = Entry.objects.all()
  
  
  class CommentResource(ModelResource):
  
      entry = fields.ForeignKey("blog.api.EntryResource", attribute="entry")
      upvotes = fields.IntegerField(readonly=True)
  
      class Meta:
          queryset = Comment.objects.all()
  
  
  api = Api(api_name="v1")
  api.register(EntryResource())
  api.register(CommentResource())
  
new_contents: from tastypie.resources import ModelResource
  from tastypie.api import Api
  from tastypie import fields
  from models import Entry, Comment, SmartTag
  
  
  class EntryResource(ModelResource):
  
      class Meta:
          queryset = Entry.objects.all()
  
  
  class CommentResource(ModelResource):
  
      entry = fields.ForeignKey("blog.api.EntryResource", attribute="entry")
      upvotes = fields.IntegerField(readonly=True)
  
      class Meta:
          queryset = Comment.objects.all()
  
  
  class SmartTagResource(ModelResource):
  
      entry = fields.ForeignKey("blog.api.EntryResource", attribute="entry")
  
      class Meta:
          queryset = SmartTag.objects.all()
          resource_name = 'smart-tag'
  
  
  api = Api(api_name="v1")
  api.register(EntryResource())
  api.register(CommentResource())
  api.register(SmartTagResource())
  
subject: Create corresponding SmartTag resource with explicitly defined 'resource_name' attribute that will be used for its TastyFactory key.