小编Sni*_*per的帖子

ArrayField缺少1个必需的位置参数

我导入了以下头文件

from django.contrib.postgres.fields import ArrayField
Run Code Online (Sandbox Code Playgroud)

在模型中使用以下内容

question_array = ArrayField(models.IntegerField, blank=True,)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

Traceback (most recent call last)
  File "C:\Program Files (x86)\Python\Python35-32\lib\site-packages\django-1.10.4-py3.5.egg\django\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Program Files (x86)\Python\Python35-32\lib\site-packages\django-1.10.4-py3.5.egg\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "C:\Program Files (x86)\Python\Python35-32\lib\site-packages\django-1.10.4-py3.5.egg\django\apps\config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Program Files (x86)\Python\Python35-32\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen …
Run Code Online (Sandbox Code Playgroud)

python django

9
推荐指数
1
解决办法
1857
查看次数

Fabric8 docker-maven-plugin 无法为图像设置标签

使用以下插件

<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.33</version
Run Code Online (Sandbox Code Playgroud)

并使用以下配置(只需在此处发布相关位)

    <configuration>
      <verbose>build</verbose>
      <images>
        <image>
          <name>${container.imageNameWithTag}</name>
          <build>
            <labels>
              <dummy.label>dummyLabelValue</dummy.label>
            </labels>
            <contextDir>${project.basedir}/src/main/docker</contextDir>
           <assembly>some required assembly </assembly>
          </build>
         </image>
        </images>
    </configuration>

    <executions>
      <execution>
        <id>docker-build</id>
        <goals>
          <goal>build</goal>
        </goals>
        <phase>package</phase>
      </execution>
    </executions>
Run Code Online (Sandbox Code Playgroud)

但最终的图像只有这些标签

        "Labels": {
            "org.label-schema.build-date": "20181204",
            "org.label-schema.license": "GPLv2",
            "org.label-schema.name": "CentOS Base Image",
            "org.label-schema.schema-version": "1.0",
            "org.label-schema.vendor": "CentOS"
        }
Run Code Online (Sandbox Code Playgroud)

我认为来自centos基础图像,但没有dummy.label

我是否缺少任何配置,或者任何配置错误?

该插件的文档位于Maven Docker Plugin

maven-plugin docker fabric8 docker-maven-plugin

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