Fakultas Ilmu Komputer UI

Skip to content
  • Ichlasul Affan's avatar
    Fixed multiple things on Django 2.2 and Python 3 compatibility · 38030300
    Ichlasul Affan authored
    1. Add on_delete parameter for OneToOneField and ForeignKey at models.
       on_delete param becomes mandatory at Django 2.
    2. Change "import views_constants" to "from core.views import views_constants".
       Python 3 didn't support direct module importing.
    3. Replace "@list_route(" to "@action(detail=False," and replace "@detail_route(" to "@action(detail=True,".
       Django REST Framework removed those decorators and replaced it with @action.
    4. Replace "basestring" type to "str" as Python 3 now supports unified string type.
    5. Use 'rb' instead of 'r' mode to read file at _create_test_file at test_accounts.py
       Python 3 has their own bytes type that not enforcing to encode things out.
    38030300