这是我的网站网址http://webtrick.heliohost.org/ 我的模板目录设置:
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__) , 'templates').replace('\\','/')
)
Run Code Online (Sandbox Code Playgroud)
from django.http import HttpResponse
from django.template import Template , Context
from django.shortcuts import render_to_response
def index(request):
return render_to_response('index.html')
Run Code Online (Sandbox Code Playgroud)
from django.conf.urls.defaults import patterns, include, url
from webtrickster.views import index
urlpatterns = patterns('',
url(r'^$', index)
)
Run Code Online (Sandbox Code Playgroud)
我不知道这个代码有什么问题,任何帮助表示赞赏
我试图以递归方式遍历MongoDB模型中的第n个节点.这是我的用户模型.
用户模型
var UserSchema = new Schema({
firstname : { type: String},
parents:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
children:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
partner:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
sibling:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
});
Run Code Online (Sandbox Code Playgroud)
我不知道如何从这个模型中生成一个类似树的结构,关于如何实现这个的任何想法?,我使用Mongoose作为模型,并且尝试深度树和填充没有解决,因为它只适用于第一级.
提前致谢.