小编Mic*_*ael的帖子

Gittle - "意外的关键字参数'pkey'"

我正在尝试使用库gittle来克隆git存储库,我按照自述文件中的示例进行操作,这是我的代码.

repo_path = '/path/to/dir/'
repo_url  = 'git@gitlab.myproject/proj.git'
key = open('/path/to/.ssh/id_rsa')
auth = GittleAuth(pkey=key)
repo = Gittle.clone(repo_url, repo_path, auth=auth)
Run Code Online (Sandbox Code Playgroud)

当我尝试运行它时,我遇到了这个异常:

Traceback (most recent call last):
  File "gitCmd2.py", line 26, in <module>
    gitinit()
  File "gitCmd2.py", line 11, in gitinit
    repo = Gittle.clone(repo_url, repo_path, auth=auth)
  File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 439, in clone
    repo.fetch(bare=bare)
  File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 406, in fetch
    remote_refs = self.fetch_remote(origin_uri)
  File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 363, in fetch_remote
    client, remote_path = self.get_client(origin_uri=origin_uri)
  File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 327, in get_client
    client, remote_path = get_transport_and_path(origin_uri, **client_kwargs)
  File …
Run Code Online (Sandbox Code Playgroud)

python git python-2.7

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

Django queryset - 是否可以对 FloatField 进行过滤?

我\xe2\x80\x99m 尝试执行一个非常简单的操作,但遇到问题。\n我有一个简单的模型:

\n\n
class MyModel(models.Model):\n    date = models.DateTimeField(null=False)\n    value = models.FloatField(null=True)\n    interval = models.IntegerField(null=True)\n
Run Code Online (Sandbox Code Playgroud)\n\n

我的目标是获取具有最大值的 MyModel 对象。

\n\n
#Get the value\nvalue = MyModel.objects.filter(date__gte=\xe2\x80\x992014-05-01\xe2\x80\x99, date__lte=\xe2\x80\x992014-05-31\xe2\x80\x99).aggregate(Max(\xe2\x80\x98value\xe2\x80\x99))[\xe2\x80\x98value__max\xe2\x80\x99]\n\n# Get the object corresponding to the max value\nmy_object = MyModel.objects.get(value=value)\n
Run Code Online (Sandbox Code Playgroud)\n\n

此代码引发错误:\xe2\x80\x9c匹配查询不存在\xe2\x80\x9d\xe2\x80\xa6\n我尝试硬编码一个值(存在),我有同样的错误。

\n\n

难道我做错了什么 ?\xe2\x80\x99 是否可以在 FloatField 上进行过滤?

\n\n

谢谢。

\n

python django django-queryset

3
推荐指数
1
解决办法
5749
查看次数

标签 统计

python ×2

django ×1

django-queryset ×1

git ×1

python-2.7 ×1