当元素的顶部对齐时,我没有问题让文本环绕div,但我无法弄清楚如何在div的上方和下方包含文本.
例如,我希望文本为40px的#container的全宽,然后将其环绕到右边,然后再次全宽.
请参阅http://jsfiddle.net/cope360/wZw7T/1/.我在#inset中添加上边距的地方是我要包装文本的地方.这可能吗?
CSS:
#inset {
width: 100px;
height: 100px;
background: gray;
float: left;
margin-top: 40px;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="container">
<div id="inset">Inset</div>
This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text …Run Code Online (Sandbox Code Playgroud) 这是我的配置文件:
[loggers]
keys=root
[handlers]
keys=TimedRotatingFileHandler
[formatters]
keys=simpleFormatter
[logger_root]
level=DEBUG
handlers=TimedRotatingFileHandler
[handler_TimedRotatingFileHandler]
class=handlers.TimedRotatingFileHandler
level=DEBUG
formatter=simpleFormatter
args=('driver.log', 'midnight', 1, 30)
[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt=
Run Code Online (Sandbox Code Playgroud)
在我的代码中,我设置并使用这样的记录器:
import logging
import logging.config
logging.config.fileConfig('logging.conf')
logging.info('Some message...')
Run Code Online (Sandbox Code Playgroud)
消息记录到我指定的文件(driver.log),但午夜轮换永远不会发生.
该过程必须在午夜运行才能进行轮换吗?这是一个批处理过程,我每15分钟运行一次,它实际上从未在午夜运行.
我有一个主要实体是a的应用程序,Story用户可以为每个故事投票.每个投票增加一个vote_count故事.
我担心会对故事发表争论,所以我计划为每个故事使用分片计数器来跟踪投票.
现在我的问题是:我如何获得按投票数排序的故事列表?例如:显示50个最高票数的故事.
我最初的想法是定期运行一个任务,读取计数器值并更新实际故事的属性.通过投票查询的结果可能会略微过时.
对于这个问题,请考虑使用多租户数据库的应用程序,其中包含制造商和模型的建模.如果我们谈论汽车,那么制造商将是福特,雪佛兰,宝马等,而型号将是F-150,Camaro和M3.
模型与制造商的关系是多对一的.使用customer_id分隔每个租户的数据.
数据模型的要求:
在这个例子中:
以下是符合所有要求的带注释的示例实现.
制造商表格
/*
* Master manufacturers shared between all customers
*/
CREATE TABLE master_manufacturers (
master_manufacturer_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
attribute_1 VARCHAR(50),
/* ... */
attribute_n VARCHAR(50),
PRIMARY KEY (master_manufacturer_id)
);
INSERT INTO
master_manufacturers (master_manufacturer_id, name)
VALUES
(1, 'Ford'),
(2, 'Chevrolet'),
(3, 'BMW');
/*
* A Customer's manufacturer.
* If master_manufacturer_id IS NULL, then it is a custom manufacturer and manufacturer_custom contains …Run Code Online (Sandbox Code Playgroud) 我将在Web应用程序中添加一项功能,允许用户导入数据.我不想重新发明轮子,所以我正在寻找可以整合的任何模块来处理这个问题.
界面应类似于将文件导入Excel或Access以及ETL软件中常见的一些更复杂的映射和类型转换函数.
一般流程: