小编Cub*_*Eye的帖子

HTML5 sessionStorage限制?

一些问题涉及HTML5的sessionStorage:

  • localStorage的5MB限制是否包含sessionStorage?(即,它是否真的是WebStorage API的5MB限制)
  • 如果不是,sessionStorage的最大大小限制类似于localStorage?

我在另一个SO问题中找到了这个网站http://dev-test.nemikor.com/web-storage/support-test/,我想知道数据是否仍然相关?

html5 web-storage sessionstorage

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

为什么Kohana使用before()和after()

我刚刚开始与Kohana一起玩,来自CodeIgniter和直接的php.我想知道为什么Kohana使用before()after()函数而不是普通的构造函数和析构函数?

php kohana

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

提交按钮上的alt参数有什么意义?

我最近在一本书中查看了一些代码,并在页面中查看了他们所拥有的页面:

<input type="submit" value="Add To Cart" name="submit" alt="Add To Cart" />
Run Code Online (Sandbox Code Playgroud)

我知道如果你使用图像作为按钮,输入就在那里.但有没有任何理由说明为什么它在这个例子中或者它们只是覆盖基础.

html forms

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

Django:使用另一个表的结果过滤对象?

关于如何在Django中做到这一点,我有一个心理上的空白,希望你能提供帮助.

我有一个画廊表,我按类型过滤:

public_galleries = models.Gallery.objects.filter(type = 2).filter(root_gallery__isnull = True)
Run Code Online (Sandbox Code Playgroud)

但我还想看看特定用户的UserGallery表中是否存在该库.我有这个用户列表:

user_galleries = models.UserGallery.objects.select_related().filter(clientuser=request.user.id).filter(gallery__root_gallery__isnull = True)
Run Code Online (Sandbox Code Playgroud)

注意**刚刚开始将Django用于实际项目,因此对这两种语句的任何改进也表示赞赏.

编辑 - 模特:

class Gallery(models.Model):
    """Gallery model"""
    name = models.CharField(u"Gallery name", max_length=120)
    type = models.IntegerField(default=0, choices=TYPE_CHOICES)
    root_gallery = models.ForeignKey("self", blank=True, null=True)
    """ Other Fields"""

class UserGallery(models.Model):
    """Model to link Gallery and ClientUser"""
    gallery = models.ForeignKey(Gallery)
    clientuser = models.ForeignKey(ClientUser)
    owner = models.BooleanField(default=False)
Run Code Online (Sandbox Code Playgroud)

django django-views

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

标签 统计

django ×1

django-views ×1

forms ×1

html ×1

html5 ×1

kohana ×1

php ×1

sessionstorage ×1

web-storage ×1