Flask error prompt: syntax error: position parameter follows keyword parameter

  1. question

I want to query the data of the user signin=0 within a time range in the CarJob_User table. Syntax error: the positional parameter follows the keyword argument. What is wrong with the following code?

2. Code

    today = datetime.date.today()
    signday = today - datetime.timedelta(days=60)
    unsignin = CarJob_User.query.filter_by(user_id = current_user.userid, signin = 0, jobdate.between(signday, today)).first()
    if unsignin:

error prompt:
File "E:01.Projectscar_manager_flaskappcarroutes.py", line 67

unsignin = CarJob_User.query.filter_by(user_id = current_user.userid, signin = 0, jobdate.between(signday, today)).first()
                                                                                 ^

SyntaxError: positional argument follows keyword argument

3.

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

May.09,2022

jobdate.between () is a positional parameter. Filter_by cannot be used, but filter should be used. And you need to specify a table name.

unsignin = CarJob_User.query.filter (CarJob_User.jobdate.between (signday, today)). Filter_by (user_id = current_user.userid, signin = 0). First ()

Menu