<s> from django . contrib . auth . models import User , Group <EOL> from django . contrib . comments . models import Comment <EOL> from tastypie . fields import CharField , ForeignKey , ManyToManyField , OneToOneField , OneToManyField <EOL> from tastypie . resources import ModelResource <EOL> from complex . models import Post , Profile <EOL> class ProfileResource ( ModelResource ) : <EOL> class Meta : <EOL> queryset = Profile . objects . all ( ) <EOL> resource_name = '<STR_LIT>' <EOL> class CommentResource ( ModelResource ) : <EOL> class Meta : <EOL> queryset = Comment . objects . all ( ) <EOL> resource_name = '<STR_LIT>' <EOL> class GroupResource ( ModelResource ) : <EOL> class Meta : <EOL> queryset = Group . objects . all ( ) <EOL> resource_name = '<STR_LIT>' <EOL> class UserResource ( ModelResource ) : <EOL> groups = ManyToManyField ( GroupResource , '<STR_LIT>' , full = True ) <EOL> profile = OneToOneField ( ProfileResource , '<STR_LIT>' , full = True ) <EOL> class Meta : <EOL> queryset = User . objects . all ( ) <EOL> resource_name = '<STR_LIT>' <EOL> class PostResource ( ModelResource ) : <EOL> user = ForeignKey ( UserResource , '<STR_LIT:user>' ) <EOL> comments = OneToManyField ( CommentResource , '<STR_LIT>' , full = False ) <EOL> class Meta : <EOL> queryset = Post . objects . all ( ) <EOL> resource_name = '<STR_LIT>' </s>
