Skip to content

Instantly share code, notes, and snippets.

View grillazz's full-sized avatar
💭
I may be slow to respond.

Jakub Miazek grillazz

💭
I may be slow to respond.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am grillazz on github.
  • I am grillazz (https://keybase.io/grillazz) on keybase.
  • I have a public key ASA146K8yDmIuhpImRdIBDvs3uC5vwGWgRoYDkdL1zcHhwo

To claim this, I am signing this object:

@grillazz
grillazz / serializers.py
Created September 24, 2019 09:29
DRF overwriting __init__ for Serializer to conditionally add fields.
from rest_framework.serializers import HyperlinkedModelSerializer
from dry_rest_permissions.generics import DRYPermissionsField
from .models import CustomUser
class CustomUserSerializer(HyperlinkedModelSerializer):
permissions = DRYPermissionsField(additional_actions=["activate", "deactivate"])
class Meta: