[Answered ]-Abstract Forms Django : __init__() got multiple values for argument

2👍

SchemeEditForm is interpreting the first positional argument you are passing it as being the id_fields argument. When you later try to pass id_fields by name, it thinks it is getting a duplicate of that argument and you are getting an error.

Try changing your __init__() method to accept arbitrary positional arguments before your keyword arguments like this:

def __init__(self, *args, id_fields=None, ref_field=None, model=None, **kwargs):

I am not sure if this will get you the results you want in terms of how your forms function, but it will get rid of the error you are seeing. Note that this method will not work in Python 2.X, only Python 3.

Leave a comment