zetonteam / zeton_django

Hacktoberfest
Apache License 2.0
10 stars 2 forks source link

Session 011 - endpoint api/students/{id}/points #66

Closed MartaSien closed 3 months ago

MartaSien commented 4 months ago

06.03.2024

  1. We work on endpoint: api/students/{id}/points

  2. How should the response look like? It should return a list, but of how many last records?

  3. We decided to implement pagination. We tried to test it in console, but we were unable to import models in django shell

  4. We verified if the endpoint is secure. Only a caregiver of a given student should access their summary of points. We needed to add this check.

  5. Getting n last records by passing n via query params

MartaSien commented 3 months ago
LOGGING = {
    'version': 1,
    'filters': {
        'require_debug_true': {
            '()': 'django.utils.log.RequireDebugTrue',
        }
     },
     'handlers': {
        'console': {
            'level': 'DEBUG',
            'filters': ['require_debug_true'],
            'class': 'logging.StreamHandler',
         }
    },
    'loggers': {
        'django.db.backends': {
            'level': 'DEBUG',
            'handlers': ['console'],
        }
    }
}