class MyResource(ModelResource):


    class Meta:
        queryset = MyModel.objects.all()
resource_name = 'environment'
list_allowed_methods = ['get', 'post']
authentication = ApiKeyAuthentication()
authorization = Authorization()

def obj_create(self, bundle, **kwargs):
    return super(EnvironmentResource, self).obj_create(bundle, user=bundle.
        request.user)
Model resource with users as FK TastyPie API