LOADING

Follow me

Django admin进阶
十二月 13, 2013|IT

Django admin进阶

1. ModelAdmin.inlines 将有外键的子类包含进视图 ,实例: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100) class BookInline(admin.T

no comments
Halton Sequence
十二月 7, 2013|Whistler

Halton Sequence

In statistics, Halton sequences are sequences used to generate points in space for numerical methods such asMonte Carlo simulations. Although these sequences are deterministic they are of low discrepancy, that is, appear to be random for many purposes. They were

no comments
Django 1.6Admin(二)
十二月 6, 2013|IT

Django 1.6Admin(二)

1 from django.contrib import admin class AuthorAdmin(admin.ModelAdmin): date_hierarchy = ‘pub_date’ 将所date字段放到列表最上端 2. ModelAdmin.actions_on_top ModelAdmin.actions_on_bottom 设置action在顶端还是底部 &#13

no comments
Django 1.6Admin
十二月 6, 2013|IT

Django 1.6Admin

1. ModelAdmin.inlines 将有外键的子类包含进视图 ,实例: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100) class BookInline(a

no comments
Django ORM advanced(二)
十二月 5, 2013|IT

Django ORM advanced(二)

ORM的extra方法接受的参数: select——————-修改SELECT语句 where——————-提供境外的WHERE子句 tables——————-提供额外的表 params—————-安全的替换动态参数

no comments
Django ORM涉阶(一)
十二月 5, 2013|IT

Django ORM涉阶(一)

看了下ORM的反向关系 首先定义2个模型: class Book(models.Model): title=models.CharField() author=models.ForeignKey(Author) class Author(models.Model): name=models.CharField() 看下的操作: book=Book.objects.get(title=’ss’) author=Book.author &#13

no comments
6 / 5340
1 2 3 4 6