6

Вопрос по – Tastypie obj_create - как использовать вновь созданный объект?

Error: User Rate Limit Exceeded

  def obj_create(self, bundle, request=None, **kwargs):
    return super(GoalResource, self).obj_create(bundle, request, user=request.user)

Error: User Rate Limit Exceeded

2ответа

10

Error: User Rate Limit Exceededtastypie.resources.ModelResourceError: User Rate Limit Exceeded

def obj_create(self, bundle, request=None, **kwargs):
    bundle = super(GoalResource, self).obj_create(
        bundle, request, user=request.user)

    user = request.user
    user.goals.add( bundle.obj )
    user.save()
    return bundle

Error: User Rate Limit Exceededobj_createError: User Rate Limit ExceededModelResourceError: User Rate Limit Exceededbundle.objError: User Rate Limit Exceededobj_createError: User Rate Limit Exceeded

Error: User Rate Limit ExceededUserError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

6

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

RelatedQuestions