Skip to content

Error with ForeignKey fields position #9

@Nielssie

Description

@Nielssie

The position of the foreignkey field in the fields tuple is not flexible.
current situation (in the example) only works with the first foreignkey field on the t position.
This works:

    fields = (
        'id',
        'title',
        'director', <-- FK
        'country', <-- FK
        'parents_guide',
        'imdb_rating',
        'genre',
        'imdb_link',
    )

This gives a javascript error:

    fields = (
        'id',
        'title',
        'imdb_rating',
        'director', <-- FK
        'country', <-- FK
        'parents_guide',
       'genre',
        'imdb_link',
    )
This gives also a javascript error:
    fields = (
        'id',
        'title',
        'director', #<-- FK
        'imdb_rating',
        'country', #<--FK
        'parents_guide',
        'imdb_rating',
        'genre',
        'imdb_link',
    )

This gives a form validation error:

    fields = (
        'id',
        'director',
        'country',
        'title',
        'imdb_rating',
        'parents_guide',
        'imdb_rating',
        'genre',
        'imdb_link',
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Q&AQuestions and answers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions