Recently in 开发 Category

今天从django的svn拉出一份出来写点东东,写好了models,runserver查看admin的时候却出现了如下提示
You don't have permission to edit anything
翻了一下文档,发现已经0.97的时候变化了很多的东东。最后说明是要这样写。
urls.py里写入
from django.contrib import admin
admin.autodiscover()

settings.py中的INSTALLED_APPS部分加入

 INSTALLED_APPS = (
    'django.contrib.admin')

models.py的最后要写上

from django.contrib import admin
admin.site.register(MODELNAME)

这样才算是OK。
update: django 1.0之后的应该把上面这一段放到admin.py里去,而且要把以前写在models.py里的class admin部分也放到admin.py例子如下:

from django.contrib import admin
from models import Module
class ModuleAdmin(admin.ModelAdmin):
	list_display = ['name','manager','isdpool']
	filter_horizontal = ['host']
admin.site.register(Module,ModuleAdmin)
最近在读C陷阱与缺陷,正好有朋友问到了在写Shell Script时要注意哪些东东。总结一下:
  • 注意空格
    • 有空格:在条件语句(if while until)中注意方括号与判定语句之间有空格
    • 没有空格:在赋值语句(=)等号两边是没有空格格的
其他的想起来了再写吧。

刚才在twitter上听到做完Project要写Pseudocode,不知道是什么东东,快快的去查了一下,才知道是要抛开LANG来写逻辑部分。

比如Hello World可以在pseudocode中这样写

output hello world

感觉上Apple Script应该是同一类的东东,但是能干活。

About this Archive

This page is a archive of recent entries in the 开发 category.

工作 is the previous category.

生活 is the next category.

Find recent content on the main index or look in the archives to find all content.

July 2008: Monthly Archives

Pages

Powered by Movable Type 4.21-en