tastypie

    0熱度

    1回答

    我想使用自定義url實現資源的刪除。因此,我沒有在默認資源Tastypie url上允許DELETE,而是定義了一個新的。刪除工程,但我仍然收到一個錯誤,因爲我確定我在我的代碼中缺少一些東西。執行刪除的功能是cancel_ride_request。 class DemandResource(ModelResource): """ Handles ride requests resources.

    0熱度

    2回答

    我使用Django與Tastypie庫和Django-OAuth-Toolkit和Tastypie authentication for the Django-OAuth-Toolkit。 聲明:有一個機會,我完全錯了這一切。如果是這樣,請糾正我,引導我走向無知。 主要問題:如何創建用戶安全? 我的理解: 爲了get或post,客戶端需要令牌。 爲了獲得令牌,they need to login。

    0熱度

    1回答

    我的問題是,我如何正確編寫我自己的定製認證? 我一直奉行這樣的: http://django-tastypie.readthedocs.org/en/latest/authentication.html#implementing-your-own-authentication-authorization 我已經實現了基本的方法, api.py def prepareResponce(responc

    0熱度

    1回答

    當我創建一個tastypie API並在其上運行GET時,它會執行一個元數據查詢來計算表上的條目數。 DEBUG [django.db.backends:89] (0.001) SELECT COUNT(*) AS "__count" FROM "lookup_job_types"; args=() DEBUG [django.db.backends:89] (0.000) SELECT "l

    0熱度

    1回答

    我很難搞清楚如何提出這個問題。 我有一個模型User。目前,當我想訪問特定用戶時,我轉到網址:/api/v1/user/8/。雖然,所有用戶都有唯一的用戶名,所以我想通過使用url:/api/v1/user/joe/轉到特定用戶。 也許與prepend_urls()有什麼不同?

    1熱度

    1回答

    所以我們有一個Django/tastypie服務器,它有以下(簡化)模型。如果我刪除了alter_detail_data_to_serialize: { "release": false, "resource_uri": "/api/packages/1", "id": 1, "branch": { "resource_uri": "/api/b

    0熱度

    1回答

    我有一個在Django用我自己的用戶類擴展了User Django的類: class MyUser(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True, related_name='my_user') theme = models.IntegerF

    4熱度

    1回答

    我試圖重寫get_bundle_detail_data class MyResourse(ModelResource): foo = fields.CharField(attribute = 'modelA__variableOnModelA') def get_bundle_detail_data(self, bundle): return bundle.obj.

    0熱度

    1回答

    爲什麼我的api沒有顯示任何pk的租賃模型?我用tastypie來休息api。畫廊模式的標識顯示而不是租賃model.This的是我的API class RentalResource(MultipartResource,ModelResource): gallery = fields.ToManyField('rentals.api.api.GalleryResource', 'gall

    1熱度

    1回答

    我有兩個型號: class Question(models.Model): question_text = models.TextField() class Response(models.Model): response_text = models.TextField() question = models.ForeignKey(Question, relate