入社1週年です

社会人でもっとも長期間働いた記録を更新中です。 日々プログラミングとか、そうじゃないこととかしてます。

そんなことよりOSSもゴリゴリ書いています。 最近は matcha という WSGIアプリケーション向けのディスパッチャーを書いてます。 昨日 0.2 リリースしたのでそろそろ良い感じに使えます。

振り返りとか意識高い話とかを聞きたい人は飲み行きましょうヾ(´∀`)ノキャッキャ

Limiting to add a specific model from django admin

The common way is handling it by setting permittions of user. But in some cases, we need a limitation to add/change/delete a specific model for all of users (such as limiting to add a AsyncTask model).

it’s easy:

class MyModelAdmin(admin.ModelAmdin):
    def has_add_permission(self, request):
        return False

forcible, a little. You can use this way for them too:

  • change: has_change_permission
  • delete: has_delete_permission