这很容易Series。我只是将其传递给paginator。但是,当我使用时DataFrame,它被称为“系列的真值不明确”。也许count方法有问题,但我不知道该如何更改。在我的项目中,DataFrame必须按行在页面上拆分。
def listing(request):
contact_list = pd.DataFrame(np.arange(12).reshape(4,3))
paginator = Paginator(contact_list, 1) # Show 1 row per page
page = request.GET.get('page')
try:
contacts = paginator.page(page)
except PageNotAnInteger:
# If page is not an integer, deliver first page.
contacts = paginator.page(1)
except EmptyPage:
# If page is out of range (e.g. 9999), deliver last page of results.
contacts = paginator.page(paginator.num_pages)
return render(request, 'list.html', {'contacts': contacts})
Run Code Online (Sandbox Code Playgroud) 我有两个遥控器和两个本地分支机构:
这是在我的 .git/config 文件中:
...
[remote "origin"]
url = http://my.gitlab.com/nandoquintana/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "github"]
url = https://github.com/nandoquintana/repo.git
fetch = +refs/heads/*:refs/remotes/github/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "mirror"]
remote = github
merge = refs/heads/master
[push]
default = tracking
Run Code Online (Sandbox Code Playgroud)
这是“git Remote show origin”的输出:
$ git remote show origin
* remote origin
Fetch URL: http://my.gitlab.com/nandoquintana/repo.git
Push URL: http://my.gitlab.com/nandoquintana/repo.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local …Run Code Online (Sandbox Code Playgroud) 当我跑
terraform planRun Code Online (Sandbox Code Playgroud)
它显示了 Terraform 所做更改的列表,并在输出结束时通知“没有更改。您的基础设施与配置匹配。”:
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply":
# google_sql_database_instance.db1 has been changed
~ resource "google_sql_database_instance" "db1" {
id = "db1"
name = "db1"
# (12 unchanged attributes hidden)
....
whole list of objects to update
....
....
Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to …Run Code Online (Sandbox Code Playgroud)