from django conf urls defaults import from muzx news models import New

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from django.conf.urls.defaults import *
from muzx.news.models import News, Menu, Page
from django.contrib.auth.models import User
from datetime import datetime
def aaa():
user = User.objects.all()[0]
field_names = [f.name for f in user._meta.fields]
for field_name in field_names:
return '%s: %s' % (field_name, getattr(user, field_name))
extra = {
'template': 'profile.html',
'extra_context': {
'merged' : aaa(),
'left_menu':Menu.objects.filter(side='left',page__name='news'),
'right_menu':Menu.objects.filter(side='right',page__name='news'),
},
}
urlpatterns = patterns('',
(r'^$','django.views.generic.simple.direct_to_template',extra),
)