Python论坛  - 讨论区

标题:[python-chinese] django generic view的困惑

2007年09月07日 星期五 13:38

klutz chump chumpklutz在gmail.com
星期五 九月 7 13:38:05 HKT 2007

学习

*The Django Book: **第**9章 Generic views*

*列表/细节generic views *
写了一些代码 这是urls.py的内容:

from django.conf.urls.defaults import *
from django.views.generic import list_detail
from bookstore.models import Author,Publisher,Book

author_list_info={'queryset':Author.objects.all()}

urlpatterns = patterns('',
    # Example:
    # (r'^mysite/', include('mysite.foo.urls')),
     (r'^authors/$',list_detail,dict(author_list_info)),

    # Uncomment this for admin:
     (r'^admin/', include('django.contrib.admin.urls')),
)



错误如下:


 AttributeError at /authors/ 'module' object has no attribute 'rindex'  Request
Method: GET Request URL: http://localhost:8000/authors/ Exception Type:
AttributeError Exception Value: 'module' object has no attribute
'rindex' Exception
Location: c:\python25\Lib\site-packages\django\core\urlresolvers.py in
get_mod_func, line 25
 Traceback (innermost last) Switch to copy-and-paste
view<http://localhost:8000/authors/#>


   - c:\python25\Lib\site-packages\django\core\handlers\base.py in
   get_response
      1. return response
      2.
      3. # Get urlconf from request object, if available. Otherwise
      use default.
      4. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
      5.
      6. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
      7. try:
    1. callback, callback_args, callback_kwargs = resolver.resolve(
      request.path) ...
    1.
      2. # Apply view middleware
      3. for middleware_method in self._view_middleware:
      4. response = middleware_method(request, callback,
      callback_args, callback_kwargs)
      5. if response:
      6. return response
   ▶ Local vars <http://localhost:8000/authors/#>
     Variable Value  debug 
    exceptions 
    mail_admins 
    middleware_method <
   django.contrib.auth.middleware.AuthenticationMiddleware object at
   0x015E4A50>>
    request , POST:, COOKIES:{'sessionid': '512a32fe59db04c44918acd59c3dcb82'},
   META:{'ALLUSERSPROFILE': 'C:\\Documents and Settings\\All Users', 'APPDATA':
   'C:\\Documents and Settings\\sweayerteng\\Application Data', 'CI_HOLOS_CLI':
   'C:\\Program Files\\Seagate Software\\Open Olap\\', 'CLIENTNAME': 'Console',
   'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'COMPUTERNAME':
   'TENGWEI', 'COMSPEC': 'C:\\WINDOWS\\system32\\cmd.exe', 'CONTENT_LENGTH':
   '', 'CONTENT_TYPE': 'text/plain', 'DJANGO_SETTINGS_MODULE': '
   mysite.settings', 'FP_NO_HOST_CHECK': 'NO', 'GATEWAY_INTERFACE':
   'CGI/1.1', 'HOMEDRIVE': 'C:', 'HOMEPATH': '\\Documents and
   Settings\\sweayerteng', 'HTTP_ACCEPT': 'image/gif, image/x-xbitmap,
   image/jpeg, image/pjpeg, application/vnd.ms-excel,
   application/vnd.ms-powerpoint, application/msword,
   application/x-shockwave-flash, application/xaml+xml,
   application/vnd.ms-xpsdocument, application/x-ms-xbap,
   application/x-ms-application, */*', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
   'HTTP_ACCEPT_LANGUAGE': 'zh-tw', 'HTTP_CONNECTION': 'Keep-Alive',
   'HTTP_COOKIE': 'sessionid=512a32fe59db04c44918acd59c3dcb82', 'HTTP_HOST':
   'localhost:8000', 'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE
   6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.590;
   .NET CLR 3.5.20706)', 'INCLUDE': 'D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\atl\\include;D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\mfc\\include;D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\include', 'LIB': 'D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\mfc\\lib;D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\lib', 'LOGONSERVER': '\\\\SHHQDC2', 'NUMBER_OF_PROCESSORS':
   '1', 'OS': 'Windows_NT', 'PATH': 'd:\\oracle\\ora92\\bin;C:\\Program
   Files\\Oracle\\jre\\1.3.1\\bin;C:\\Program
   Files\\Oracle\\jre\\1.1.8\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;d:\\Program
   Files\\Intec Systems\\common;C:\\Program Files\\Microsoft SQL
   Server\\80\\Tools\\BINN;C:\\Program Files\\Microsoft SQL
   Server\\90\\Tools\\binn\\;d:\\Program Files;D:\\Program Files\\Microsoft
   Visual Studio\\Common\\Tools\\WinNT;D:\\Program Files\\Microsoft Visual
   Studio\\Common\\MSDev98\\Bin;D:\\Program Files\\Microsoft Visual
   Studio\\Common\\Tools;D:\\Program Files\\Microsoft Visual
   Studio\\VC98\\bin;C:\\Python25;C:\\Python25\\Lib\\site-packages\\django\\bin',
   'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH', 'PATH_INFO':
   '/authors/', 'PROCESSOR_ARCHITECTURE': 'x86', 'PROCESSOR_IDENTIFIER': 'x86
   Family 15 Model 2 Stepping 7, GenuineIntel', 'PROCESSOR_LEVEL': '15',
   'PROCESSOR_REVISION': '0207', 'PROGRAMFILES': 'C:\\Program Files', 'PROMPT':
   '$P$G', 'QUERY_STRING': '', 'RAV': 'C:\\Documents and Settings\\All
   Users\\Application Data\\Rising\\Rav', 'REMOTE_ADDR': '127.0.0.1',
   'REMOTE_HOST': '', 'REQUEST_METHOD': 'GET', 'RUN_MAIN': 'true',
   'SCRIPT_NAME': '', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8000',
   'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1
   Python/2.5', 'SESSIONNAME': 'Console', 'SYSTEMDRIVE': 'C:', 'SYSTEMROOT':
   'C:\\WINDOWS', 'TEMP': 'C:\\DOCUME~1\\SWEAYE~1\\LOCALS~1\\Temp', 'TMP':
   'C:\\DOCUME~1\\SWEAYE~1\\LOCALS~1\\Temp', 'USERDNSDOMAIN': '
   SH.NCIC.CORP', 'USERDOMAIN': 'SH', 'USERNAME': 'sweayerteng',
   'USERPROFILE': 'C:\\Documents and Settings\\sweayerteng', 'VS90COMNTOOLS':
   'D:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\',
   'WF_RESOURCES': 'd:\\oracle\\ora92\\WF\\RES\\WFus.RES', 'WINDIR':
   'C:\\WINDOWS', 'wsgi.errors': ', mode 'w' at
   0x00B6F0B0>, 'wsgi.file_wrapper': , 'wsgi.input':
   , 'wsgi.multiprocess': False,
   'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme':
   'http', 'wsgi.version': (1, 0)}>
    resolver 
    response None
    self 
    settings 
    urlconf 'mysite.urls'
    urlresolvers 
   - c:\python25\Lib\site-packages\django\core\urlresolvers.py in resolve
      1. def resolve(self, path):
      2. tried = []
      3. match = self.regex.search(path)
      4. if match:
      5. new_path = path[match.end():]
      6. for pattern in self.urlconf_module.urlpatterns:
      7. try:
    1. sub_match = pattern.resolve(new_path) ...
    1. except Resolver404, e:
      2. tried.extend([(pattern.regex.pattern + ' ' + t) for t in
      e.args[0]['tried']])
      3. else:
      4. if sub_match:
      5. sub_match_dict = dict(self.default_kwargs, **sub_match[2])
      6. return sub_match[0], sub_match[1], dict(match.groupdict(),
      **sub_match_dict)
   ▶ Local vars <http://localhost:8000/authors/#>
     Variable Value  match <_sre.SRE_Match object at 0x01662988>
    new_path 'authors/'
    path '/authors/'
    pattern 
    self 
    tried []
   - c:\python25\Lib\site-packages\django\core\urlresolvers.py in resolve
      1. if kwargs:
      2. args = ()
      3. else:
      4. args = match.groups()
      5. # In both cases, pass any extra_kwargs as **kwargs.
      6. kwargs.update(self.default_args)
      7.
    1. return self.callback, args, kwargs ...
    1.
      2. def _get_callback(self):
      3. if self._callback is not None:
      4. return self._callback
      5. mod_name, func_name = get_mod_func(self._callback_str)
      6. try:
   ▶ Local vars <http://localhost:8000/authors/#>
     Variable Value  args ()
    kwargs {'queryset': [, , ,
   ]}
    match <_sre.SRE_Match object at 0x016629C0>
    path 'authors/'
    self 
   - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
   _get_callback
      1. kwargs.update(self.default_args)
      2.
      3. return self.callback, args, kwargs
      4.
      5. def _get_callback(self):
      6. if self._callback is not None:
      7. return self._callback
    1. mod_name, func_name = get_mod_func(self._callback_str) ...
    1. try:
      2. self._callback = getattr(__import__(mod_name, {}, {}, ['']),
      func_name)
      3. except ImportError, e:
      4. raise ViewDoesNotExist, "Could not import %s. Error was: %s"
      % (mod_name, str(e))
      5. except AttributeError, e:
      6. raise ViewDoesNotExist, "Tried %s in module %s. Error was:
      %s" % (func_name, mod_name, str(e))
   ▶ Local vars <http://localhost:8000/authors/#>
     Variable Value  self

   - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
   get_mod_func
      1. # Don't make this raise an error when used in a template.
      2. silent_variable_failure = True
      3.
      4. def get_mod_func(callback):
      5. # Converts 'django.views.news.stories.story_detail' to
      6. # ['django.views.news.stories', 'story_detail']
      7. try:
    1. dot = callback.rindex('.') ...
    1. except ValueError:
      2. return callback, ''
      3. return callback[:dot], callback[dot+1:]
      4.
      5. def reverse_helper(regex, *args, **kwargs):
      6. """
   ▶ Local vars <http://localhost:8000/authors/#>
     Variable Value  callback 

  Traceback (most recent call last):
File "c:\python25\Lib\site-packages\django\core\handlers\base.py" in
get_response
  68. callback, callback_args, callback_kwargs = resolver.resolve(
request.path)
File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in resolve
  162. sub_match = pattern.resolve(new_path)
File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in resolve
  118. return self.callback, args, kwargs
File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
_get_callback
  123. mod_name, func_name = get_mod_func(self._callback_str)
File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
get_mod_func
  25. dot = callback.rindex('.')

  AttributeError at /authors/
  'module' object has no attribute 'rindex'
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20070907/ffbdd7bd/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月07日 星期五 13:41

klutz chump chumpklutz在gmail.com
星期五 九月 7 13:41:51 HKT 2007

不好意思,自己搞错了,现已搞定





2007/9/7, klutz chump <chumpklutz在gmail.com>:
>
>  学习
>
> *The Django Book: **第**9章 Generic views*
>
> *列表/ 细节generic views *
> 写了一些代码 这是urls.py的内容:
>
> from django.conf.urls.defaults import *
> from django.views.generic import list_detail
> from bookstore.models import Author,Publisher,Book
>
> author_list_info={'queryset':Author.objects.all()}
>
> urlpatterns = patterns('',
>     # Example:
>     # (r'^mysite/', include('mysite.foo.urls')),
>      (r'^authors/$',list_detail,dict(author_list_info)),
>
>     # Uncomment this for admin:
>      (r'^admin/', include('django.contrib.admin.urls')),
> )
>
>
>
> 错误如下:
>
>
>  AttributeError at /authors/ 'module' object has no attribute 'rindex'  Request
> Method: GET Request URL: http://localhost:8000/authors/ Exception Type:
> AttributeError Exception Value: 'module' object has no attribute 'rindex' Exception
> Location: c:\python25\Lib\site-packages\django\core\urlresolvers.py in
> get_mod_func, line 25
>  Traceback (innermost last) Switch to copy-and-paste view<http://localhost:8000/authors/#>
>
>
>    - c:\python25\Lib\site-packages\django\core\handlers\base.py in
>    get_response
>       1. return response
>       2.
>       3. # Get urlconf from request object, if available. Otherwise
>       use default.
>       4. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
>
>       5.
>       6. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
>       7. try:
>     1. callback, callback_args, callback_kwargs = resolver.resolve(
>       request.path) ...
>     1.
>       2. # Apply view middleware
>       3. for middleware_method in self._view_middleware:
>       4. response = middleware_method(request, callback,
>       callback_args, callback_kwargs)
>       5. if response:
>       6. return response
>    ▶ Local vars <http://localhost:8000/authors/#>
>      Variable Value  debug >    'C:\Python25\lib\site-packages\django\views\debug.pyc'>
>     exceptions >    'C:\Python25\lib\site-packages\django\core\exceptions.pyc'>
>     mail_admins 
>     middleware_method >    AuthenticationMiddleware.process_request of <
>    django.contrib.auth.middleware.AuthenticationMiddleware object at
>    0x015E4A50>>
>     request ,
>    POST:, COOKIES:{'sessionid':
>    '512a32fe59db04c44918acd59c3dcb82'}, META:{'ALLUSERSPROFILE': 'C:\\Documents
>    and Settings\\All Users', 'APPDATA': 'C:\\Documents and
>    Settings\\sweayerteng\\Application Data', 'CI_HOLOS_CLI': 'C:\\Program
>    Files\\Seagate Software\\Open Olap\\', 'CLIENTNAME': 'Console',
>    'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'COMPUTERNAME':
>    'TENGWEI', 'COMSPEC': 'C:\\WINDOWS\\system32\\cmd.exe', 'CONTENT_LENGTH':
>    '', 'CONTENT_TYPE': 'text/plain', 'DJANGO_SETTINGS_MODULE': '
>    mysite.settings', 'FP_NO_HOST_CHECK': 'NO', 'GATEWAY_INTERFACE':
>    'CGI/1.1', 'HOMEDRIVE': 'C:', 'HOMEPATH': '\\Documents and
>    Settings\\sweayerteng', 'HTTP_ACCEPT': 'image/gif, image/x-xbitmap,
>    image/jpeg, image/pjpeg, application/vnd.ms-excel,
>    application/vnd.ms-powerpoint, application/msword,
>    application/x-shockwave-flash, application/xaml+xml,
>    application/vnd.ms-xpsdocument, application/x-ms-xbap,
>    application/x-ms-application, */*', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
>    'HTTP_ACCEPT_LANGUAGE': 'zh-tw', 'HTTP_CONNECTION': 'Keep-Alive',
>    'HTTP_COOKIE': 'sessionid=512a32fe59db04c44918acd59c3dcb82', 'HTTP_HOST':
>    'localhost:8000', 'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE
>    6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.590;
>    .NET CLR 3.5.20706)', 'INCLUDE': 'D:\\Program Files\\Microsoft
>    Visual Studio\\VC98\\atl\\include;D:\\Program Files\\Microsoft Visual
>    Studio\\VC98\\mfc\\include;D:\\Program Files\\Microsoft Visual
>    Studio\\VC98\\include', 'LIB': 'D:\\Program Files\\Microsoft Visual
>    Studio\\VC98\\mfc\\lib;D:\\Program Files\\Microsoft Visual
>    Studio\\VC98\\lib', 'LOGONSERVER': '\\\\SHHQDC2', 'NUMBER_OF_PROCESSORS':
>    '1', 'OS': 'Windows_NT', 'PATH': 'd:\\oracle\\ora92\\bin;C:\\Program
>    Files\\Oracle\\jre\\1.3.1\\bin;C:\\Program
>    Files\\Oracle\\jre\\1.1.8\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;d:\\Program
>    Files\\Intec Systems\\common;C:\\Program Files\\Microsoft SQL
>    Server\\80\\Tools\\BINN;C:\\Program Files\\Microsoft SQL
>    Server\\90\\Tools\\binn\\;d:\\Program Files;D:\\Program Files\\Microsoft
>    Visual Studio\\Common\\Tools\\WinNT;D:\\Program Files\\Microsoft Visual
>    Studio\\Common\\MSDev98\\Bin;D:\\Program Files\\Microsoft Visual
>    Studio\\Common\\Tools;D:\\Program Files\\Microsoft Visual
>    Studio\\VC98\\bin;C:\\Python25;C:\\Python25\\Lib\\site-packages\\django\\bin',
>    'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH', 'PATH_INFO':
>    '/authors/', 'PROCESSOR_ARCHITECTURE': 'x86', 'PROCESSOR_IDENTIFIER': 'x86
>    Family 15 Model 2 Stepping 7, GenuineIntel', 'PROCESSOR_LEVEL': '15',
>    'PROCESSOR_REVISION': '0207', 'PROGRAMFILES': 'C:\\Program Files', 'PROMPT':
>    '$P$G', 'QUERY_STRING': '', 'RAV': 'C:\\Documents and Settings\\All
>    Users\\Application Data\\Rising\\Rav', 'REMOTE_ADDR': ' 127.0.0.1',
>    'REMOTE_HOST': '', 'REQUEST_METHOD': 'GET', 'RUN_MAIN': 'true',
>    'SCRIPT_NAME': '', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8000',
>    'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1
>    Python/2.5', 'SESSIONNAME': 'Console', 'SYSTEMDRIVE': 'C:', 'SYSTEMROOT':
>    'C:\\WINDOWS', 'TEMP': 'C:\\DOCUME~1\\SWEAYE~1\\LOCALS~1\\Temp', 'TMP':
>    'C:\\DOCUME~1\\SWEAYE~1\\LOCALS~1\\Temp', 'USERDNSDOMAIN': '
>    SH.NCIC.CORP', 'USERDOMAIN': 'SH', 'USERNAME': 'sweayerteng',
>    'USERPROFILE': 'C:\\Documents and Settings\\sweayerteng', 'VS90COMNTOOLS':
>    'D:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\',
>    'WF_RESOURCES': 'd:\\oracle\\ora92\\WF\\RES\\WFus.RES', 'WINDIR':
>    'C:\\WINDOWS', 'wsgi.errors': ', mode 'w' at
>    0x00B6F0B0>, ' wsgi.file_wrapper': >    django.core.servers.basehttp.FileWrapper'>, 'wsgi.input':
>    , 'wsgi.multiprocess':
>    False, 'wsgi.multithread': True, ' wsgi.run_once': False, '
>    wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}>
>     resolver >    0x015E4B90>
>     response None
>     self 
>     settings 
>     urlconf 'mysite.urls'
>     urlresolvers >    'C:\Python25\lib\site-packages\django\core\urlresolvers.pyc'>
>    - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
>    resolve
>       1. def resolve(self, path):
>       2. tried = []
>       3. match = self.regex.search(path)
>       4. if match:
>       5. new_path = path[match.end():]
>       6. for pattern in self.urlconf_module.urlpatterns:
>       7. try:
>     1. sub_match = pattern.resolve(new_path) ...
>     1. except Resolver404, e:
>       2. tried.extend([(pattern.regex.pattern + ' ' + t) for t in
>       e.args[0]['tried']])
>       3. else:
>       4. if sub_match:
>       5. sub_match_dict = dict(self.default_kwargs, **sub_match[2])
>       6. return sub_match[0], sub_match[1], dict(match.groupdict(),
>       **sub_match_dict)
>    ▶ Local vars <http://localhost:8000/authors/#>
>      Variable Value  match <_sre.SRE_Match object at 0x01662988>
>     new_path 'authors/'
>     path '/authors/'
>     pattern >    0x016561B0>
>     self >    0x015E4B90>
>     tried []
>    - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
>    resolve
>       1. if kwargs:
>       2. args = ()
>       3. else:
>       4. args = match.groups()
>       5. # In both cases, pass any extra_kwargs as **kwargs.
>       6. kwargs.update(self.default_args)
>       7.
>     1. return self.callback, args, kwargs ...
>     1.
>       2. def _get_callback(self):
>       3. if self._callback is not None:
>       4. return self._callback
>       5. mod_name, func_name = get_mod_func(self._callback_str)
>       6. try:
>    ▶ Local vars <http://localhost:8000/authors/#>
>      Variable Value  args ()
>     kwargs {'queryset': [, , ,
>    ]}
>     match <_sre.SRE_Match object at 0x016629C0>
>     path 'authors/'
>     self >    0x016561B0>
>    - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
>    _get_callback
>       1. kwargs.update(self.default_args)
>       2.
>       3. return self.callback, args, kwargs
>       4.
>       5. def _get_callback(self):
>       6. if self._callback is not None:
>       7. return self._callback
>     1. mod_name, func_name = get_mod_func(self._callback_str) ...
>     1. try:
>       2. self._callback = getattr(__import__(mod_name, {}, {},
>       ['']), func_name)
>       3. except ImportError, e:
>       4. raise ViewDoesNotExist, "Could not import %s. Error was:
>       %s" % (mod_name, str(e))
>       5. except AttributeError, e:
>       6. raise ViewDoesNotExist, "Tried %s in module %s. Error was:
>       %s" % (func_name, mod_name, str(e))
>    ▶ Local vars <http://localhost:8000/authors/#>
>      Variable Value  self 
>    - c:\python25\Lib\site-packages\django\core\urlresolvers.py in
>    get_mod_func
>       1. # Don't make this raise an error when used in a template.
>       2. silent_variable_failure = True
>       3.
>       4. def get_mod_func(callback):
>       5. # Converts 'django.views.news.stories.story_detail' to
>       6. # ['django.views.news.stories', 'story_detail']
>       7. try:
>     1. dot = callback.rindex('.') ...
>     1. except ValueError:
>       2. return callback, ''
>       3. return callback[:dot], callback[dot+1:]
>       4.
>       5. def reverse_helper(regex, *args, **kwargs):
>       6. """
>    ▶ Local vars <http://localhost:8000/authors/#>
>      Variable Value  callback >    from 'C:\Python25\lib\site-packages\django\views\generic\list_detail.pyc'>
>
>   Traceback (most recent call last):
> File "c:\python25\Lib\site-packages\django\core\handlers\base.py" in
> get_response
>   68. callback, callback_args, callback_kwargs = resolver.resolve(
> request.path )
> File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
> resolve
>   162. sub_match = pattern.resolve(new_path)
> File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
> resolve
>   118. return self.callback, args, kwargs
> File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
> _get_callback
>   123. mod_name, func_name = get_mod_func(self._callback_str)
> File "c:\python25\Lib\site-packages\django\core\urlresolvers.py" in
> get_mod_func
>   25. dot = callback.rindex('.')
>
>   AttributeError at /authors/
>   'module' object has no attribute 'rindex'
>
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20070907/85bec087/attachment-0001.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号