Re: ImageField via admin
Grigory Fateyev wrote: > Hello Carl Karsten! > On Tue, 21 Aug 2007 10:21:06 -0500 you wrote: > >> Grigory Fateyev wrote: >>> Hello Carl Karsten! >>> On Mon, 20 Aug 2007 14:07:39 -0500 you wrote: >>> > settings.py:MEDIA_ROOT = BASE_DIR+'/media/' > settings.py:MEDIA_URL = '/site_media/' > urls.py:(r'^site_media/(?P.*)$', > 'django.views.static.serve', {'document_root': > settings.BASE_DIR+'/media/', 'show_indexes':True}), > > Revision: 5946 > I used your settings, no problem. Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [EMAIL PROTECTED]:~/django/django_src$ svn up Updated to revision 5988. Carl K >>> That means you can add any object to Book class without problem? >>> >>> Thanks! >> yep. edit too. >> >> I suggest making a new site/project, add the model, make the few >> changes to settings and run the dev server. >> >> Carl K > > Very funny, but new project with the only class "Book" return the same > error: > > Traceback (most recent call last): > File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in > get_response 77. response = callback(request, *callback_args, > **callback_kwargs) File > "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" > in _checklogin 51. if 'post_data' in request.POST: File > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > _get_post 136. self._load_post_and_files() File > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > _load_post_and_files 114. self._post, self._files = > http.parse_file_upload(self.environ['wsgi.input'], self.environ) File > "/usr/lib/python2.4/site-packages/django/http/__init__.py" in > parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for > pair in header_dict.items()]) > > AttributeError at /admin/books/book/add/ > '_fileobject' object has no attribute 'items' > do you have access to a python 25 box? Make sure django is up to date. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Hello Carl Karsten! On Tue, 21 Aug 2007 10:21:06 -0500 you wrote: > > Grigory Fateyev wrote: > > Hello Carl Karsten! > > On Mon, 20 Aug 2007 14:07:39 -0500 you wrote: > > > >>> settings.py:MEDIA_ROOT = BASE_DIR+'/media/' > >>> settings.py:MEDIA_URL = '/site_media/' > >>> urls.py:(r'^site_media/(?P.*)$', > >>> 'django.views.static.serve', {'document_root': > >>> settings.BASE_DIR+'/media/', 'show_indexes':True}), > >>> > >>> Revision: 5946 > >>> > >> I used your settings, no problem. > >> > >> Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) > >> > >> [EMAIL PROTECTED]:~/django/django_src$ svn up > >> Updated to revision 5988. > >> > >> Carl K > > > > That means you can add any object to Book class without problem? > > > > Thanks! > > yep. edit too. > > I suggest making a new site/project, add the model, make the few > changes to settings and run the dev server. > > Carl K Very funny, but new project with the only class "Book" return the same error: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response 77. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" in _checklogin 51. if 'post_data' in request.POST: File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _get_post 136. self._load_post_and_files() File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _load_post_and_files 114. self._post, self._files = http.parse_file_upload(self.environ['wsgi.input'], self.environ) File "/usr/lib/python2.4/site-packages/django/http/__init__.py" in parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for pair in header_dict.items()]) AttributeError at /admin/books/book/add/ '_fileobject' object has no attribute 'items' -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/21 20:43 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Hello Carl Karsten! On Tue, 21 Aug 2007 10:21:06 -0500 you wrote: > > Grigory Fateyev wrote: > > Hello Carl Karsten! > > On Mon, 20 Aug 2007 14:07:39 -0500 you wrote: > > > >>> settings.py:MEDIA_ROOT = BASE_DIR+'/media/' > >>> settings.py:MEDIA_URL = '/site_media/' > >>> urls.py:(r'^site_media/(?P.*)$', > >>> 'django.views.static.serve', {'document_root': > >>> settings.BASE_DIR+'/media/', 'show_indexes':True}), > >>> > >>> Revision: 5946 > >>> > >> I used your settings, no problem. > >> > >> Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) > >> > >> [EMAIL PROTECTED]:~/django/django_src$ svn up > >> Updated to revision 5988. > >> > >> Carl K > > > > That means you can add any object to Book class without problem? > > > > Thanks! > > yep. edit too. > > I suggest making a new site/project, add the model, make the few > changes to settings and run the dev server. > > Carl K Very funny, but new project with the only class "Book" return the same error: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response 77. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" in _checklogin 51. if 'post_data' in request.POST: File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _get_post 136. self._load_post_and_files() File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _load_post_and_files 114. self._post, self._files = http.parse_file_upload(self.environ['wsgi.input'], self.environ) File "/usr/lib/python2.4/site-packages/django/http/__init__.py" in parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for pair in header_dict.items()]) AttributeError at /admin/books/book/add/ '_fileobject' object has no attribute 'items' -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/21 20:43 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Grigory Fateyev wrote: > Hello Carl Karsten! > On Mon, 20 Aug 2007 14:07:39 -0500 you wrote: > >>> settings.py:MEDIA_ROOT = BASE_DIR+'/media/' >>> settings.py:MEDIA_URL = '/site_media/' >>> urls.py:(r'^site_media/(?P.*)$', >>> 'django.views.static.serve', {'document_root': >>> settings.BASE_DIR+'/media/', 'show_indexes':True}), >>> >>> Revision: 5946 >>> >> I used your settings, no problem. >> >> Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) >> >> [EMAIL PROTECTED]:~/django/django_src$ svn up >> Updated to revision 5988. >> >> Carl K > > That means you can add any object to Book class without problem? > > Thanks! yep. edit too. I suggest making a new site/project, add the model, make the few changes to settings and run the dev server. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Hello Carl Karsten! On Mon, 20 Aug 2007 14:07:39 -0500 you wrote: > > settings.py:MEDIA_ROOT = BASE_DIR+'/media/' > > settings.py:MEDIA_URL = '/site_media/' > > urls.py:(r'^site_media/(?P.*)$', > > 'django.views.static.serve', {'document_root': > > settings.BASE_DIR+'/media/', 'show_indexes':True}), > > > > Revision: 5946 > > > > I used your settings, no problem. > > Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) > > [EMAIL PROTECTED]:~/django/django_src$ svn up > Updated to revision 5988. > > Carl K That means you can add any object to Book class without problem? Thanks! -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/21 16:08 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Grigory Fateyev wrote: > Hello Carl Karsten! > On Sun, 19 Aug 2007 21:39:31 -0500 you wrote: > >> Grigory Fateyev wrote: >>> Hello! >>> >>> I have simple class with ImageField, but cann't add any object: >>> >>> class Book(models.Model): >>> name = models.CharField(_('Book Title'), maxlength=200) >>> book_number = models.IntegerField() >>> image = models.ImageField(upload_to='%Y/%m/%d/', core=True, >>> blank=True) >>> comment = models.TextField(_('Book Comment'), blank=True, >>>null=True) >>> author = models.CharField(_('Author'), maxlength=100, >>> blank=True) >>> year_rate = models.IntegerField() >>> >>> class Meta: >>> verbose_name = _('Book') >>> verbose_name_plural = _('Books') >>> >>> class Admin: >>> list_display = ('book_number', 'name', 'year_rate') >>> >>> def __unicode__(self): >>> return u"%s %s %s" % (self.book_number, self.name, >>> self.year_rate) >>> >>> the error: >>> >>> Traceback (most recent call last): >>> File >>> "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in >>> get_response 77. response = callback(request, *callback_args, >>> **callback_kwargs) File >>> "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" >>> in _checklogin 51. if 'post_data' in request.POST: File >>> "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in >>> _get_post 135. self._load_post_and_files() >>> File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in >>> _load_post_and_files 113. self._post, self._files = >>> http.parse_file_upload(self.environ['wsgi.input'], self.environ) >>> File "/usr/lib/python2.4/site-packages/django/http/__init__.py" in >>> parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for >>> pair in header_dict.items()]) >>> >>> AttributeError at /admin/books/book/add/ >>> '_fileobject' object has no attribute 'items' >>> >>> What the problem it can be? >>> >> I just made a project with just that model. works for me. >> I would start by looking at these lines: >> >> [EMAIL PROTECTED]:~/django/foo/foot$ grep static * >> settings.py:# settings.py:MEDIA_ROOT = BASE_DIR+'/static/' >> settings.py:MEDIA_URL = '/static/' >> urls.py:(r'^static/(?P.*)$', 'django.views.static.serve', >> {'document_root': settings.BASE_DIR+'/static/', 'show_indexes': >> True}), >> >> What version of django? I am using current svn. >> >> Carl K >> > > settings.py:MEDIA_ROOT = BASE_DIR+'/media/' > settings.py:MEDIA_URL = '/site_media/' > urls.py:(r'^site_media/(?P.*)$', 'django.views.static.serve', > {'document_root': settings.BASE_DIR+'/media/', 'show_indexes':True}), > > Revision: 5946 > I used your settings, no problem. Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [EMAIL PROTECTED]:~/django/django_src$ svn up Updated to revision 5988. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Hello Carl Karsten! On Sun, 19 Aug 2007 21:39:31 -0500 you wrote: > > Grigory Fateyev wrote: > > Hello! > > > > I have simple class with ImageField, but cann't add any object: > > > > class Book(models.Model): > > name = models.CharField(_('Book Title'), maxlength=200) > > book_number = models.IntegerField() > > image = models.ImageField(upload_to='%Y/%m/%d/', core=True, > > blank=True) > > comment = models.TextField(_('Book Comment'), blank=True, > >null=True) > > author = models.CharField(_('Author'), maxlength=100, > > blank=True) > > year_rate = models.IntegerField() > > > > class Meta: > > verbose_name = _('Book') > > verbose_name_plural = _('Books') > > > > class Admin: > > list_display = ('book_number', 'name', 'year_rate') > > > > def __unicode__(self): > > return u"%s %s %s" % (self.book_number, self.name, > > self.year_rate) > > > > the error: > > > > Traceback (most recent call last): > > File > > "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in > > get_response 77. response = callback(request, *callback_args, > > **callback_kwargs) File > > "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" > > in _checklogin 51. if 'post_data' in request.POST: File > > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > > _get_post 135. self._load_post_and_files() File > > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > > _load_post_and_files 113. self._post, self._files = > > http.parse_file_upload(self.environ['wsgi.input'], self.environ) > > File "/usr/lib/python2.4/site-packages/django/http/__init__.py" in > > parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for > > pair in header_dict.items()]) > > > > AttributeError at /admin/books/book/add/ > > '_fileobject' object has no attribute 'items' > > > > What the problem it can be? > > > > I just made a project with just that model. works for me. > I would start by looking at these lines: > > [EMAIL PROTECTED]:~/django/foo/foot$ grep static * > settings.py:# settings.py:MEDIA_ROOT = BASE_DIR+'/static/' > settings.py:MEDIA_URL = '/static/' > urls.py:(r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': settings.BASE_DIR+'/static/', 'show_indexes': > True}), > > What version of django? I am using current svn. > > Carl K > settings.py:MEDIA_ROOT = BASE_DIR+'/media/' settings.py:MEDIA_URL = '/site_media/' urls.py:(r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.BASE_DIR+'/media/', 'show_indexes':True}), Revision: 5946 the same error. -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/20 17:22 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField via admin
Grigory Fateyev wrote: > Hello! > > I have simple class with ImageField, but cann't add any object: > > class Book(models.Model): > name = models.CharField(_('Book Title'), maxlength=200) > book_number = models.IntegerField() > image = models.ImageField(upload_to='%Y/%m/%d/', core=True, > blank=True) > comment = models.TextField(_('Book Comment'), blank=True, >null=True) > author = models.CharField(_('Author'), maxlength=100, > blank=True) > year_rate = models.IntegerField() > > class Meta: > verbose_name = _('Book') > verbose_name_plural = _('Books') > > class Admin: > list_display = ('book_number', 'name', 'year_rate') > > def __unicode__(self): > return u"%s %s %s" % (self.book_number, self.name, > self.year_rate) > > the error: > > Traceback (most recent call last): > File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in > get_response 77. response = callback(request, *callback_args, > **callback_kwargs) File > "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" > in _checklogin 51. if 'post_data' in request.POST: File > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > _get_post 135. self._load_post_and_files() File > "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in > _load_post_and_files 113. self._post, self._files = > http.parse_file_upload(self.environ['wsgi.input'], self.environ) File > "/usr/lib/python2.4/site-packages/django/http/__init__.py" in > parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for > pair in header_dict.items()]) > > AttributeError at /admin/books/book/add/ > '_fileobject' object has no attribute 'items' > > What the problem it can be? > I just made a project with just that model. works for me. I would start by looking at these lines: [EMAIL PROTECTED]:~/django/foo/foot$ grep static * settings.py:# settings.py:MEDIA_ROOT = BASE_DIR+'/static/' settings.py:MEDIA_URL = '/static/' urls.py:(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.BASE_DIR+'/static/', 'show_indexes': True}), What version of django? I am using current svn. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ImageField via admin
Hello! I have simple class with ImageField, but cann't add any object: class Book(models.Model): name = models.CharField(_('Book Title'), maxlength=200) book_number = models.IntegerField() image = models.ImageField(upload_to='%Y/%m/%d/', core=True, blank=True) comment = models.TextField(_('Book Comment'), blank=True, null=True) author = models.CharField(_('Author'), maxlength=100, blank=True) year_rate = models.IntegerField() class Meta: verbose_name = _('Book') verbose_name_plural = _('Books') class Admin: list_display = ('book_number', 'name', 'year_rate') def __unicode__(self): return u"%s %s %s" % (self.book_number, self.name, self.year_rate) the error: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response 77. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" in _checklogin 51. if 'post_data' in request.POST: File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _get_post 135. self._load_post_and_files() File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py" in _load_post_and_files 113. self._post, self._files = http.parse_file_upload(self.environ['wsgi.input'], self.environ) File "/usr/lib/python2.4/site-packages/django/http/__init__.py" in parse_file_upload 71. raw_message = '\r\n'.join(['%s:%s' % pair for pair in header_dict.items()]) AttributeError at /admin/books/book/add/ '_fileobject' object has no attribute 'items' What the problem it can be? -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/19 18:05 -- Всего наилучшего! Григорий greg [at] anastasia [dot] ru Письмо отправлено: 2007/08/19 18:11 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---