小编Sid*_*pta的帖子

如何将大量数据发布到 Django?

我正在尝试将文件列表发送到我的 Django 网站。每组都与以下信息一起传输:

  • 文档名称,
  • 文件大小,
  • 文件位置,
  • 文件类型

现在,假设我有 100 组这样的数据,我想将它发送到我的 Django 网站,我应该使用的最佳方法是什么?

PS:我正在考虑使用 JSON,然后将该 JSON 数据发布到我的 Django URL。数据可能如下所示:

{
  "files": [
    { "filename":"Movie1" , "filesize":"702", "filelocation":"C:/", "filetype":"avi" }, 
    { "filename":"Movie2" , "filesize":"800", "filelocation":"C:/", "filetype":"avi" }, 
    { "filename":"Movie3" , "filesize":"900", "filelocation":"C:/", "filetype":"avi" }
  ]
}
Run Code Online (Sandbox Code Playgroud)

python django ajax web

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

Google Now喜欢iOS上的界面

所以,我非常喜欢Android上的Google Now卡片界面.最近它甚至还来到了iOS.

是否有任何教程或示例项目可以帮助我为我的iOS应用程序创建卡片界面?

根据我的研究,我已经能够使用自定义UICollectionViewFlowLayout复制"堆叠"卡.

- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
    NSArray *allAttributesInRect = [super layoutAttributesForElementsInRect:rect];

    CGPoint centerPoint = CGPointMake(CGRectGetMidX(self.collectionView.bounds), CGRectGetMidY(self.collectionView.bounds));

    for (UICollectionViewLayoutAttributes *cellAttributes in allAttributesInRect)
    {
        if (CGRectContainsPoint(cellAttributes.frame, centerPoint))
        {
            cellAttributes.transform = CGAffineTransformIdentity;
            cellAttributes.zIndex = 1.0;
        }
        else
        {
            cellAttributes.transform = CGAffineTransformMakeScale(0.75, 0.75);
        }
    }

    return allAttributesInRect;
}
Run Code Online (Sandbox Code Playgroud)

然后我将最小行间距设置为负值,使它们显示为"堆叠".

滚动时,我希望卡片保持在底部,只有一辆汽车可以向上扩展并在屏幕中居中.然后我会将该卡从屏幕上滚动,堆栈中的下一张"卡片"将从堆栈向上滚动并在屏幕上居中.我猜这会动态调整最小行间距?

iphone objective-c ios google-now

4
推荐指数
1
解决办法
9210
查看次数

这个身体是如何在动画中完成的?

我发现了" http://thegoodman.cc/ ".这是一个绝对惊人的网站.

我真的很好奇,关于这个文档的主体是如何略微淡入,并在这个页面中向上滑动:

http://thegoodman.cc/about/

javascript css jquery animation css-animations

0
推荐指数
1
解决办法
116
查看次数