建立这个Dockerfile
:
FROM ubuntu:19.10
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y locales apt-utils
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get install --no-install-recommends -y vim
CMD /bin/bash
Run Code Online (Sandbox Code Playgroud)
输出一些警告消息:
update-alternatives: warning: skip creation of /usr/share/man/da/man1/vi.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/de/man1/vi.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: …
Run Code Online (Sandbox Code Playgroud) 我今天早上尝试安装几个模块以使Eclipse FP工作,scion-browser和buildwrapper失败.
[root@localhost ghc-mod]# cabal install scion-browser
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: scion-browser-0.3.0
[root@localhost ghc-mod]# cabal install buildwrapper
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: buildwrapper-0.8.0
Run Code Online (Sandbox Code Playgroud)
我简单地继续#haskell IRC,但无法得到答案,但我没有在IRC中长时间闲逛.然后我放弃了EclipseFP并与vim一起走上了快乐的道路.我之前使用过vim用于其他语言,我认为即使我可能没有调试器也会很好.但好奇心让我安装了一些插件,可以增强我在haskell的编码体验,但其中一个插件需要ghc-mod所以我想我会cabal install
再去一次.我最终得到了以下错误.
[root@localhost ghc-mod]# cabal install ghc-mod
Resolving dependencies...
Configuring ghc-mod-0.3.0...
Building ghc-mod-0.3.0...
Preprocessing executable 'ghc-mod' for ghc-mod-0.3.0...
[1 of 6] Compiling Param ( Param.hs, dist/build/ghc-mod/ghc-mod-tmp/Param.o )
[2 of 6] Compiling Lang ( Lang.hs, dist/build/ghc-mod/ghc-mod-tmp/Lang.o )
[3 of 6] Compiling List ( List.hs, dist/build/ghc-mod/ghc-mod-tmp/List.o )
[4 of …
Run Code Online (Sandbox Code Playgroud) 文档在这里:http ://www.django-rest-framework.org/api-guide/views/#get_permissionsself
在此示例中,格式设置为 none 但没有引用它:
class ListUsers(APIView):
"""
View to list all users in the system.
* Requires token authentication.
* Only admin users are able to access this view.
"""
authentication_classes = (authentication.TokenAuthentication,)
permission_classes = (permissions.IsAdminUser,)
def get(self, request, format=None):
"""
Return a list of all users.
"""
usernames = [user.username for user in User.objects.all()]
return Response(usernames)
Run Code Online (Sandbox Code Playgroud)
我检查了源代码,仍然没有参考格式。
欣赏一些清晰度
我一直在解决有关此问题的所有问题,但似乎无法找到解决方案。
我试图允许用户提交多个对象并使用带有 2 个外键的表单集保存到数据库。
我可以获取表单以将该数据保存到数据库中,但由于 ManagementForm 错误而无法获取表单集中的表单以进行保存。问题不在于我在 HTML 中没有它。(检查下面的 HMTL 代码。)我还为表单集设置了前缀。
我不知道是否需要创建自定义表单和表单集而不是使用模型。也许我需要更好地验证表单集中的信息。
我得到的错误是:
/home/aking/signatureProject/signatureApp/views.py in signatures
if formset.is_valid(): ...
Variable Value
DD <DDForm bound=True, valid=True, fields=(downdraft_id)>
PR <PRForm bound=True, valid=True, fields=(report_id;report_desc)>
SignatureFormSet <class 'django.forms.formsets.SigFormFormSet'>
formset <django.forms.formsets.SigFormFormSet object at 0x7f44601a4e10>
request <WSGIRequest: POST '/signatureApp/signatures/'>
views.py
/usr/lib64/python2.7/site-packages/django/forms/formsets.py in is_valid
forms_valid True
self <django.forms.formsets.SigFormFormSet object at 0x7f44601a4e10>
/usr/lib64/python2.7/site-packages/django/forms/formsets.py in errors
self.full_clean()
self <django.forms.formsets.SigFormFormSet object at 0x7f44601a4e10>
/usr/lib64/python2.7/site-packages/django/forms/formsets.py in full_clean
for i in range(0, self.total_form_count()):
empty_forms_count 0
self <django.forms.formsets.SigFormFormSet object at 0x7f44601a4e10>
/usr/lib64/python2.7/site-packages/django/forms/formsets.py in …
Run Code Online (Sandbox Code Playgroud) 我想知道是否可以在 swagger.yaml/json 中使用 XOR 如果我有类似的内容,例如:
PostableEntity:
properties:
first_property:
type: string
second_property:
type: string
minLength: 1
description: foo
third_property:
type: number
required:
- third_property
Run Code Online (Sandbox Code Playgroud)
现在,如果未设置 secondary_property ,我怎样才能使 first_property 成为必需的,反之亦然?
在我的views.py中我有以下代码
def cpio(request):
mainDict9=['hemant','jay','yash','Hari']
args={'mainDict9':mainDict9,}
msg_html =render_to_string('/home/user/infracom2/JournalContent/templates/JournalContent/test1.html',
{'mainDict9':mainDict9,})
from_email = 'gorantl.chowdary@ak-enterprise.com'
to_email = ['gorantla.chowdary@ak-enterprise.com']
subject="TESTING MAIL"
send_mail('email title',subject,from_email,to_email,html_message=msg_html,)
return render(request,'JournalContent/test1.html',args)
Run Code Online (Sandbox Code Playgroud)
在我的 test1.html 中我有以下代码
<!DOCTYPE html>
<html>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col" class="table-secondary"><center>Modified Binaries/components</center></th>
<th scope="col" class="table-secondary"><center>CRs</center></th>
</tr>
</thead>
<tbody>
{% for king in mainDict9 %}
<tr>
<td style="width: 10px;" class="table-active">{{ king }}</td>
<td style="width: 10px;" class="table-active"></td>
</tr>
{% endfor %}
</tbody>
</table>
</html>
Run Code Online (Sandbox Code Playgroud)
问题出在我的 GUI 中,引导代码工作正常,但是当我发送邮件中的内容时,引导函数不适用
我需要一个元素列表作为键,以便我可以检查是否满足多个条件。示例(不知道这是否可行以及语法是否正确):
mapping:
c_id:
[pak, gb]: '4711'
[pak, ch]: '4712'
[pak]: '4713'
d_id:
.
.
.
Run Code Online (Sandbox Code Playgroud)
现在我需要知道是否可以采用示例中的方法。
我想在 vim 上创建一个快捷方式来多次替换一个文件,这是我多次使用的工具。
工具示例:
:%s/this.props/otherProps/gc
Run Code Online (Sandbox Code Playgroud)
该命令会将所有 this.props 替换为 otherProps 并要求确认
但我正在尝试以快捷方式转换此命令,如下例所示:
// on .vimrc
noremap <leader>F :%s/$1/$2/gc
Run Code Online (Sandbox Code Playgroud)
因此,在这种情况下,我每次按<leader>
+时F
,都会键入第一个单词,然后按tab
并键入第二个单词,然后按 Enter 键。
我已经尝试输入$1
and $2
,但它不起作用。
我试图搜索一些关于此的文档,但我没有找到任何内容,也许有一些word
我还不知道的更具体的内容。
django ×3
python ×3
yaml ×2
api ×1
bootstrap-4 ×1
cabal ×1
docker ×1
dockerfile ×1
eclipse-fp ×1
editor ×1
haskell ×1
pyyaml ×1
swagger-2.0 ×1
swagger-ui ×1
ubuntu ×1
ubuntu-19.04 ×1
vim ×1
xor ×1