我刚刚将我的项目升级到 Angular 9,我注意到的第一件事是我的 CI 中的构建时间显着增加(从 2 分钟到 4 分钟)。
通过分析日志,每次执行测试或构建时,CLI 都会执行预编译。这是由于新的 Ivy 架构,但据我所知,这种编译应该只发生在与 Ivy 不兼容的代码上。
那么为什么我Compiling @angular/common : es2015 as esm2015
在我的构建中看到很多(主要来自@angular 包)?Angular 代码本身不应该与 Ivy 兼容吗?
注意:这也发生在一个新项目中(只有几个库)。
更新 所有需要构建的命令都会发生这种情况。前任:
ng test --code-coverage=true --watch=false --browsers=ChromeHeadle
ng b -c=staging --aot
更新 2
我正在添加我的构建以进行比较:pre angular 9和 after angular 9 迁移(构建仍然失败,但我们可以使用单元测试作为参考,从大约 2 分钟到大约 4 分钟的总执行时间)
的
pytz.NonExistentTimeError
,如果你试图让异常引发value
一个DST过渡,以使时间从未发生过(进入DST时)期间认识。设置is_dst
为True
orFalse
将通过分别将小时向后或向前移动 1来避免异常。例如,is_dst=True
将不存在的时间 2:30is_dst=False
更改为 1:30,并将时间更改为 3:30。
所以我希望时间根据 的值向前或向后移动一个is_dst
。
但是根据我的测试,时区正在改变,而不是时间。我误解了 Django 文档还是这是一个错误?
我测试了以下内容:
import pytz
import datetime
from django.utils.timezone import make_aware
tz = pytz.timezone('America/Sao_Paulo')
dt = datetime.datetime(2017, 10, 15 ,0 ,0)
print(make_aware(dt, tz)) # NonExistentTimeError
print(make_aware(dt, tz, True)) # 2017-10-15 00:00:00-02:00
print(make_aware(dt, tz, False)) # 2017-10-15 00:00:00-03:00
Run Code Online (Sandbox Code Playgroud)
2017-10-15 是 DST 将在该America/Sao_Paulo
时区开始的时间,因此当时钟到达 00:00 时,它应该跳到 01:00。该make_aware
方法返回的日期时间不存在。
我在VPS上启动selenium独立服务器时遇到了麻烦
root@PIV:/usr/share/nginx/pivdev/tests# java -jar selenium-server.jar
Run Code Online (Sandbox Code Playgroud)
输出:
21:53:08.857 INFO - Launching a standalone Selenium Server
21:53:08.911 INFO - Java: Oracle Corporation 24.79-b02
21:53:08.914 INFO - OS: Linux 3.13.0-52-generic amd64
21:53:08.945 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
21:53:09.070 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
21:53:09.071 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, browserName=MicrosoftEdge, version=}] does not …
Run Code Online (Sandbox Code Playgroud) 我需要按名字或姓氏搜索用户表过滤。
给定用户 John Doe Smith,其中 John 是名字,Doe Smith 是姓氏。
当我搜索 John Smith 时,它应该会找到上面的用户。
我知道这只是实现这个 SO 答案的解决方案的问题,但是我如何做到这一点django-filter
并保持其他过滤器字段像email
或phone
?
patient.py
(仅相关部分)
class Patient(TimeStampedModel):
name = models.CharField('Name', max_length=30)
last_name = models.CharField('Last Name', max_length=30)
phone = models.CharField('Phone', max_length=14)
Run Code Online (Sandbox Code Playgroud) python ×2
angular ×1
angular-cli ×1
angular9 ×1
django ×1
ecmascript-6 ×1
selenium ×1
typescript ×1