小编alp*_*pha的帖子

删除django Rest框架中的多个对象

我需要删除表中的所有对象。可以有一个请求“ http://localhost:8000/api/products/delete_all/ ”,当我执行获取请求时,我删除所有对象。我看到这个解决方案在 django 中删除多个对象,但我不知道是否可以在 MoldeViewSet 中实现它。

视图.py

class ProductModelViews(viewsets.ModelViewSet):
        permission_classes  =(permissions.IsAuthenticated,)
        queryset = ProductModel.objects.all()
        serializer_class = TestProductModelSerializer
Run Code Online (Sandbox Code Playgroud)

django django-rest-framework

5
推荐指数
1
解决办法
4186
查看次数

使用诗歌安装 Tensorfow 时出现 SolverProblemError

当我用诗歌添加tensoflow(诗歌添加张量流)时,我收到此错误:

Using version ^2.7.0 for tensorflow

Updating dependencies
Resolving dependencies... (0.8s)

  SolverProblemError

  The current project's Python requirement (>=3.6,<4.0) is not compatible with some of the required packages Python requirement:
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0

....

    For tensorflow-io-gcs-filesystem, a possible solution …
Run Code Online (Sandbox Code Playgroud)

python tensorflow python-poetry

4
推荐指数
1
解决办法
5117
查看次数

点击工具提示内容 vuetify

各位!我有一个问题,是否可以单击工具提示内容来调用任何函数?当我的工具提示打开时,我想单击用于调用测试功能的跨度。

<template>
    <v-tooltip v-model="show" open-on-click :open-on-hover="false" bottom close-delay="2000">
      <template v-slot:activator="{ on }">
        {{on}}
        <v-btn color="primary" dark v-on="on" fab x-small class="btn">
          <v-icon>mdi-pencil</v-icon>
        </v-btn>
      </template>
        <span @click="test">click<span>

    </v-tooltip>
</template>

<script>
export default {
  data() {
    return {
      show: false
    };
  },
  methods: {
    test: function() {
     console.log('helloo')
    }
  }
};
</script>
Run Code Online (Sandbox Code Playgroud)

vue.js vuetify.js

2
推荐指数
1
解决办法
1916
查看次数