Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

994
Views
AttributeError: type object has no attribute 'get_extra_actions'

I have a small web app, and I'm trying to develop an API for it. I'm having an issue with a model I have called Platform inside of an app I have called UserPlatforms. The same error: AttributeError: type object 'UserPlatformList' has no attribute 'get_extra_actions'

models.py:

class Platform(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL,
                             related_name='platform_owned',
                             on_delete=models.CASCADE,
                             default=10)

    PLATFORM_CHOICES = [platform_x, platform_y]

    platform_reference = models.CharField(max_length=10, choices=PLATFORM_CHOICES, default='platform_x')
    platform_variables = models.JSONField()

api/views.py

from .serializers import PlatformSerializer
from rest_framework import generics, permissions
from userplatforms.models import Platform

class UserPlatformList(generics.ListCreateAPIViewAPIView):
    queryset = Platform.objects.all()
    permisson_classes = [permissions.IsAuthenticatedOrReadOnly]
    serializer_class = PlatformSerializer

api/serializer.py

from rest_framework import serializers
from userplatforms.models import Platform
    
class PlatformSerializer(serializers.HyperlinkedModelSerializer):
        class Meta:
            model = Platform
            fields = '__all__'

api/urls.py

from django.urls import path, include
from . import views
from rest_framework import routers

router = routers.DefaultRouter()
router.register(r'userplatforms/', views.UserPlatformList, 'userplatforms')
router.register(r'userfiles/', views.UserFileList, "userfiles")
router.register(r'users/', views.UserList, "user")



urlpatterns = [
    path("^", include(router.urls))
]
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

change class PlatformSerializer(serializers.HyperlinkedModelSerializer): to class PlatformSerializer(serializers.ModelSerializer):

over 4 years ago · Santiago Trujillo Report

0

You cannot add generic Views in routers

So remove this line

router.register(r'userplatforms/', views.UserPlatformList, 'userplatforms')

and update urlpatterns to

urlpatterns = [
    path('userplatforms/', views.UserPlatformList, name='userplatforms'),
    path("^", include(router.urls))
]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!