小编use*_*660的帖子

ConflictError:数据库冲突错误

任何人都能解释我的错误 - 以及我如何修复它?

我们用:

  • Plone 4
  • Zope 2.12.19
  • ZEO
  • ZODB-暂存

错误日志

Site Error

An error was encountered while publishing this resource.

Sorry, a site error occurred.

Traceback (innermost last):

Module ZPublisher.Publish, line 239, in publish_module_standard
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 173, in publish
Module plone.app.linkintegrity.monkey, line 17, in zpublisher_exception_hook_wrapper
Module ZPublisher.Publish, line 135, in publish
Module Zope2.App.startup, line 291, in commit
Module transaction._manager, line …
Run Code Online (Sandbox Code Playgroud)

zope plone

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

如何使用 SQLAlchemy 查询 (PostgreSQL) 视图

通常我像这样连接/查询

class MyTable(Base):
    __tablename__ = 'mytable'
    __table_args__ = {'schema': 'tables'}

    id = Column(Integer, primary_key=True)
    salutation = Column(VARCHAR(1))

def __init__(self, salutation):
    self.salutation = salutation

def load():
    """"""
    Session = sessionmaker(bind=engine)
    session = Session()
    for i in session.query(MyTable).order_by(MyTable.id):
        entries.append(i.__dict__)
    session.close()
Run Code Online (Sandbox Code Playgroud)

但是我如何在没有任何键的情况下查询(PostgreSQL)数据库视图?

sqlalchemy sql-view

5
推荐指数
0
解决办法
3605
查看次数

显示开始和结束之间的年份

如何计算并显示给定Beginn和给定End之间的所有年份?

我的例子:

for item in folderContents:
    Beginn = item.Beginn.strftime('%Y')
    Ende = item.Ende.strftime('%Y')
    try:
        Beginn = Beginn
        while Beginn <= Ende:
            Beginn = Beginn + 1
            print Beginn
    except:
        pass
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助...

python datetime plone

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

python 使用列表项进行计算

这是我的清单:

['-50.00', '60.00', '-63.00', '50.00', '-57.00']
Run Code Online (Sandbox Code Playgroud)

我该如何计算这个项目

-50.00+60.00-63.00+50.00-57.00
Run Code Online (Sandbox Code Playgroud)

python list

-3
推荐指数
1
解决办法
2万
查看次数

标签 统计

plone ×2

python ×2

datetime ×1

list ×1

sql-view ×1

sqlalchemy ×1

zope ×1