更新现有记录或创建(如果不存在)

时间:2020-06-08 11:16:41

标签: mysql django django-rest-framework restapi

我正在使用与MySQL DB连接的Django Rest Framework。 我创建了一个表格“产品状态”

InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(@class, 'v-button-caption')and text()=Options de sélection] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(@class, 'v-button-caption')and text()=Options de sélection]' is not a valid XPath expression.

我想接收多个记录的POST请求,如果product_id存在,则更新记录,或者如果product_id是新的,则创建一个新记录。

我该怎么做?

0 个答案:

没有答案
相关问题