首页 \ 问答 \ Django CMS功能(Django CMS functionality)

Django CMS功能(Django CMS functionality)

几天以来,我正在考虑是否应该为我命令构建的新Web门户使用类似CMS的Django-App。 门户网站的大部分内容都将完全由模型驱动(如新闻,小广告,目录等),但有几个静态页面应由编辑人员维护。

我测试了不同的系统,如Django-CMS,FeinCMS,PyLucid和其他一些系统,但它们都有很多过载,我不需要该项目。 我基本需要的是让编辑有机会上传图片和附件,轻松地将它们放入文本体中,给它们一些属性,如宽度/高度,并输入文本作为任何标记,如纺织品或降价( 而不是以wysiwyg-编辑)。 我不想要的是将整个项目定制为CMS的结构(例如使用CMS特定的模板标签),因为门户的大部分部分都是手动设计和结构化的。 有没有我没有看到的应用程序? 我无法想象之前没有人有相同的要求。


for some days now, I'm considering whether I should use a CMS-like Django-App for a new web-portal I'm ordered to build. Most parts of the portal will be purely model-driven (like News, small ads, directories etc), but there are several static pages that shall be maintained by editors.

I tested out different systems, like Django-CMS, FeinCMS, PyLucid and some others, but they all have a lot of overload I don't need for the project. What I need basically is to give the editors the opportunity to upload images and attachments, easily place them into a text body, give them some attributes like width/height and enter a text as any markup like textile or markdown (not into a wysiwyg-editor). What I don't want is to tailor the whole project into the structure of a CMS (like using CMS-specific template-tags), since most parts of the portal are designed and structured manually. Is there any application I just did not see? I can't imagine that nobody had the same requirements before.


原文:https://stackoverflow.com/questions/3543742
更新时间:2023-05-29 19:05

最满意答案

从这个论坛帖子

persist()定义良好。 它使一个暂时的实例持久化。 但是,它不能保证将标识符值立即分配给持久性实例,所以分配可能会在冲洗时发生。 规范没有说,这是与persist()

persist()也保证它不会在事务边界之外调用INSERT语句。 这在长时间运行的会话/扩展Session /持久性上下文中很有用。

需要一个像persist()这样的方法。

save()不保证相同,它返回一个标识符,如果必须执行INSERT来获取标识符(例如“identity”而不是“sequence”),则此INSERT会立即发生,无论您是否在或在交易之外。 这在长时间运行的会话/扩展Session /持久性上下文中并不好。


From this forum post

persist() is well defined. It makes a transient instance persistent. However, it doesn't guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time. The spec doesn't say that, which is the problem I have with persist().

persist() also guarantees that it will not execute an INSERT statement if it is called outside of transaction boundaries. This is useful in long-running conversations with an extended Session/persistence context.

A method like persist() is required.

save() does not guarantee the same, it returns an identifier, and if an INSERT has to be executed to get the identifier (e.g. "identity" generator, not "sequence"), this INSERT happens immediately, no matter if you are inside or outside of a transaction. This is not good in a long-running conversation with an extended Session/persistence context.

相关问答

更多
  • 看看这个 。 也许它是有帮助的。 您是否按如下方式应用了@CollectionOfElements? @org.hibernate.annotations.CollectionOfElements( targetElement = java.lang.String.class ) Have a look at This. Maybe it is of help. Did you apply @CollectionOfElements as follows? @org.hibernate.annotatio ...
  • 你如何试图保存或实体? 通过调用“SaveOrUpdate”方法或“Persist”? How do you try to save or entities ? By calling "SaveOrUpdate" method or "Persist" ?
  • 从这个论坛帖子 persist()定义良好。 它使一个暂时的实例持久化。 但是,它不能保证将标识符值立即分配给持久性实例,所以分配可能会在冲洗时发生。 规范没有说,这是与persist() 。 persist()也保证它不会在事务边界之外调用INSERT语句。 这在长时间运行的会话/扩展Session /持久性上下文中很有用。 需要一个像persist()这样的方法。 save()不保证相同,它返回一个标识符,如果必须执行INSERT来获取标识符(例如“identity”而不是“sequence”),则此I ...
  • 不,你无法控制订单。 唯一能做的就是在做出AC关系后创建AB关系后,在会话上调用flush。 刷新将强制hibernate将新数据推送到数据库,但不会提交事务。 刷新后,根据数据库配置的不同,数据可能对其他事务可见或不可见(例如,在mysql上有4种事务模式: http : //dev.mysql.com/doc/refman/5.0/en/ set-transaction.html )。 No, you can't control the order. The only thing you can do ...
  • 取消现有注释并使用@Lob注释列表 - 这指定持久属性或字段应作为大对象持久保存到数据库支持的大对象类型 。 如果变量的类型是Serializable的子类型,您可以完全省略注释; JPA关于默认映射的规则声明可序列化而非原始或Embeddable类型被序列化并存储在BLOB列中。 但是,List不是Serializable,即使ArrayList是。 您可以将@Lob与@ElementCollection一起使用,但我不确定结果是什么; 我不知道是否序列化整个列表,或创建一个表格,其中每个列表元素分别序列 ...
  • persist()不是要立即插入行,而是在刷新时,通常在事务提交之前。 但是,如果这不是您要求的,但即使在事务结束后仍未插入行,则可能是该事务的刷新模式设置为手动 。 persist() is not meant to insert the row immediately, but rather at flush time, which is usually immediately before transaction commit. However, if this is not what you are ...
  • 在JPA中,一旦对象传递给persist(),它就会变成“托管”,因为成为托管JPA实现的一部分必须为持久对象生成一个id。 如果id生成基于自动增量(GenerationType.IDENTITY),则需要向db发出insert语句以获取并分配密钥。 当id生成基于序列/表时,则由JPA实现管理的id池管理和分配id,在这种情况下,不需要直接插入。 将对象传递给persist()并进行管理后,对其进行的任何更改都必须将持久字段刷新到事务处理中的数据库。 在您的情况下,如果id生成为Identity,则必须 ...
  • 对于要级联的save()操作,需要使用专有的Hibernate Cascade注释启用CascadeType.SAVE_UPDATE ,因为save()不是标准的JPA操作。 或者您需要使用persist()方法,而不是save()方法。 For the save() operation to be cascaded, you need to enable CascadeType.SAVE_UPDATE, using the proprietary Hibernate Cascade annotation, ...
  • 如果您完全确定运行该代码后, do.date存储在数据库中,并且do.lastAccessed不是,那么您的连接和事务显然是正确设置的。 我的第一个猜测是不正确的映射,因为这是最简单的解决方案。 你不会碰巧在场上有一个@Transient ,这个getter或者是lastAccessed的setter,是吗? (当然,假设您使用注释来映射您的域对象。) 如果你能提供一个SSCCE ,我敢打赌我或其他人可以给你一个明确的答案。 更新:很难将完整的应用程序修剪成可能的最小代码,以显示问题。 结果是,你可能会在找 ...
  • 事实证明这是一个交易问题,而不是级联类型。 我在保存scrMsgLine对象后创建了一个新的tnx。 所以当我把它传递给新的tnx时它就变得脱离了。 作为一个解决方案我在新tnx的开头从db读取它。 我将级联类型更改为PERSIST。 我不确定这是否是正确的解决方案,但现在它对我有用... It turned out to be a transaction problem instead of cascade type. I was creating a new tnx after saving the s ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。