Re: invalid literal for int() with base 10 trying to access uploaded image

2015-04-17 Thread Stephen J. Butler
On Fri, Apr 17, 2015 at 8:16 AM, Jyothi Naidu  wrote:

>
>  if 'audit_info_manage' in request.POST:
> 192 #fullname = Employee.objects.get(emp_id=request.POST['emp_id'])
> 193 audit_manage_key = request.POST.get('audit_info_getdata')
> 194 if audit_manage_key:
> 195 audit_manage_key = request.POST.get('audit_info_getdata')
> 196 if audit_manage_key:
> 197 try:
> 198 audit_info = 
> EmployeeAuditInfo.objects.get(pk=audit_manage_key)
> 199 SUCCESS_MESSAGE = 'Updated Status successfully'
> 200 except EmployeeAuditInfo.DoesNotExist:
> 201 audit_info = EmployeeAuditInfo()
> 202 SUCCESS_MESSAGE = 'Disable an Employee successfully'
> 203
> 204 if audit_info:
> 205 #form_emp_id = int(request.POST['emp_id'])
> 206 employee = 
> Employee.objects.get(emp_id=request.POST['emp_id'])
> 207 employee.save
> 208 audit_info = EmployeeAuditInfo()
> 209 audit_info.emp_id = employee
> 210 audit_info.status = request.POST['status']
> 211 audit_info.updated_by = request.user
> 212 audit_info.created_on = request.POST['created_on']
> 213 audit_info.modified_on = request.POST['modified_on']
> 214 audit_info.reason = request.POST['reason']
> 215 audit_info.save()
>
>
Line 207 doesn't save the employee object. You forgot ().

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxU_T7qp2NekkLGFVJ0R8Xh-AXuHHNw15s-2m3i3aZ5rZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid literal for int() with base 10 trying to access uploaded image

2015-04-17 Thread Jyothi Naidu

Hi Kelvin,


I am also having the similar issue where i am not able to solve it

invalid literal for int() with base 10: ''

Request Method:POSTRequest URL:
http://172.19.7.125:8001/super-admin-dashboard/status-change/Django Version:
1.6Exception Type:ValueErrorException Value:

invalid literal for int() with base 10: ''

Exception 
Location:/usr/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py
 
in get_prep_value, line 1073Python Executable:/usr/local/bin/pythonPython 
Version:2.7.3Python Path:

['/home/kra/jyothi_pms',
 '/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/python_ntlm-1.0.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/cx_Oracle-5.1.2-py2.7-linux-i686.egg',
 '/usr/local/lib/python2.7/site-packages/RBTools-0.7.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/six-1.9.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/ReviewBoard-2.0.13-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/Whoosh-2.6.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/recaptcha_client-1.0.6-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pytz-2014.10-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/python_memcached-1.53-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/python_dateutil-1.5-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/Pygments-2.0.2-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/paramiko-1.15.2-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/mimeparse-0.1.3-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/Markdown-2.4.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/docutils-0.12-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/django_haystack-2.3.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/Djblets-0.8.15-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/django_evolution-0.7.4-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/ecdsa-0.13-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pycrypto-2.6.1-py2.7-linux-i686.egg',
 '/usr/local/lib/python2.7/site-packages/pillowfight-0.2-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/feedparser-5.1.3-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/django_pipeline-1.3.27-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/futures-2.2.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/mod_wsgi-4.4.8-py2.7-linux-i686.egg',
 '/usr/local/lib/python2.7/site-packages/django_lint-0.0.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pylint-1.4.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/astroid-1.3.4-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/logilab_common-0.63.2-py2.7.egg',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']








 if 'audit_info_manage' in request.POST:
192 #fullname = Employee.objects.get(emp_id=request.POST['emp_id'])
193 audit_manage_key = request.POST.get('audit_info_getdata')
194 if audit_manage_key:
195 audit_manage_key = request.POST.get('audit_info_getdata')
196 if audit_manage_key:
197 try:
198 audit_info = 
EmployeeAuditInfo.objects.get(pk=audit_manage_key)
199 SUCCESS_MESSAGE = 'Updated Status successfully'
200 except EmployeeAuditInfo.DoesNotExist:
201 audit_info = EmployeeAuditInfo()
202 SUCCESS_MESSAGE = 'Disable an Employee successfully'
203
204 if audit_info:
205 #form_emp_id = int(request.POST['emp_id'])
206 employee = 
Employee.objects.get(emp_id=request.POST['emp_id'])
207 employee.save
208 audit_info = EmployeeAuditInfo()
209 audit_info.emp_id = employee
210 audit_info.status = request.POST['status']
211 audit_info.updated_by = request.user
212 audit_info.created_on = request.POST['created_on']
213 audit_info.modified_on = request.POST['modified_on']
214 audit_info.reason = request.POST['reason']
215 audit_info.save()





















On Thursday, September 18, 2008 at 11:05:02 PM UTC+5:30, kelvin pompey 
wrote:
>
> Is there a way to modify the html for the admin form to display the image 
> using the html img tag instead of having a link to the image?
>
> On Thu, Sep 18, 2008 at 11:50 AM, Lisa Dusseault  > wrote:
>
>> I've seen the same problem with FileFields, so it's not just 
>> ImageFields.  I haven't figured it out yet.  I can make a link to the file 
>> work from the main UI, but I don't know how the admin constructs its link 
>> in an unmodified admin form.
>>  
>> Lisa
>>
>>
>> On Thu, Sep 18, 2008 at 5:17 AM, silk.odyssey  
>> wrote:
>>
>>>
>>> I am using an imagefie

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-10-01 Thread mrtot

Hi Kelvin,

I just ran into that problem, too.
However the hint to MEDIA_URL was correct!

You must add the following to the very bottom of your urls.py:

if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P.*)$', 'django.views.static.serve',
{'document_root': 'd:sites/sgms/media'}),
)

This is described here:
http://docs.djangoproject.com/en/dev/howto/static-files/

Greetz,
M

On 20 Sep., 16:07, "kelvin pompey" <[EMAIL PROTECTED]> wrote:
> ok I've set the MEDIA_URL and MEDIA_ROOT, but when I click the link I get
> the 404 file not found error message. If i set ADMIN_MEDIA_PREFIX to a blank
> string then I can access the link. But there is a problem, when I try to
> change the image through the form I get a page does not exist error
> message.
> My current settings are
>
> MEDIA_ROOT = 'd:sites/sgms/media/'
> MEDIA_URL = 'http://localhost:8000/media/'
> ADMIN_MEDIA_PREFIX = '/media/'
>
> and the model
>
> class Student(models.Model):
>     photo = models.ImageField(upload_to='photos')
>
> I am using the automatic admin site.
>
> On Sat, Sep 20, 2008 at 7:22 AM, Srik <[EMAIL PROTECTED]> wrote:
>
> > Make sure you have MEDIA_URL set :)
>
> > Run into similar error, setting MEDIA_URL resolved it :)
>
> > On Sep 18, 1:17 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote:
> > > I am using an imagefield from the admin interface. I can upload images
> > > without problems but when I click the link to view the image, I get
> > > the following error.
>
> > > invalid literal for int() with base 10: '1/photos/desktop.png'
>
> > > Any idea what's wrong? I am using django 1.0.
>
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-20 Thread kelvin pompey
ok I've set the MEDIA_URL and MEDIA_ROOT, but when I click the link I get
the 404 file not found error message. If i set ADMIN_MEDIA_PREFIX to a blank
string then I can access the link. But there is a problem, when I try to
change the image through the form I get a page does not exist error
message.
My current settings are

MEDIA_ROOT = 'd:sites/sgms/media/'
MEDIA_URL = 'http://localhost:8000/media/'
ADMIN_MEDIA_PREFIX = '/media/'

and the model

class Student(models.Model):
photo = models.ImageField(upload_to='photos')

I am using the automatic admin site.

On Sat, Sep 20, 2008 at 7:22 AM, Srik <[EMAIL PROTECTED]> wrote:

>
> Make sure you have MEDIA_URL set :)
>
> Run into similar error, setting MEDIA_URL resolved it :)
>
> On Sep 18, 1:17 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote:
> > I am using an imagefield from the admin interface. I can upload images
> > without problems but when I click the link to view the image, I get
> > the following error.
> >
> > invalid literal for int() with base 10: '1/photos/desktop.png'
> >
> > Any idea what's wrong? I am using django 1.0.
> >
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-20 Thread Srik

Make sure you have MEDIA_URL set :)

Run into similar error, setting MEDIA_URL resolved it :)

On Sep 18, 1:17 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote:
> I am using an imagefield from the admin interface. I can upload images
> without problems but when I click the link to view the image, I get
> the following error.
>
> invalid literal for int() with base 10: '1/photos/desktop.png'
>
> Any idea what's wrong? I am using django 1.0.
--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-19 Thread barbara shaurette

Try logging out your SQL and look for any suspicious INSERTs - I've
run across this error a few times, under different circumstances,
always because my code is trying to insert a string when the column is
expecting an integer.
--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Is there a way to modify the html for the admin form to display the image
using the html img tag instead of having a link to the image?

On Thu, Sep 18, 2008 at 11:50 AM, Lisa Dusseault
<[EMAIL PROTECTED]>wrote:

> I've seen the same problem with FileFields, so it's not just ImageFields.
> I haven't figured it out yet.  I can make a link to the file work from the
> main UI, but I don't know how the admin constructs its link in an unmodified
> admin form.
>
> Lisa
>
>
> On Thu, Sep 18, 2008 at 5:17 AM, silk.odyssey <[EMAIL PROTECTED]>wrote:
>
>>
>> I am using an imagefield from the admin interface. I can upload images
>> without problems but when I click the link to view the image, I get
>> the following error.
>>
>> invalid literal for int() with base 10: '1/photos/desktop.png'
>>
>> Any idea what's wrong? I am using django 1.0.
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Lisa Dusseault
I've seen the same problem with FileFields, so it's not just ImageFields.  I
haven't figured it out yet.  I can make a link to the file work from the
main UI, but I don't know how the admin constructs its link in an unmodified
admin form.

Lisa

On Thu, Sep 18, 2008 at 5:17 AM, silk.odyssey <[EMAIL PROTECTED]> wrote:

>
> I am using an imagefield from the admin interface. I can upload images
> without problems but when I click the link to view the image, I get
> the following error.
>
> invalid literal for int() with base 10: '1/photos/desktop.png'
>
> Any idea what's wrong? I am using django 1.0.
>
> >
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio

Here is mine, since I don't know how to reference dpaste... ;)
Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/tvsite/areas/1/areas/batzos.jpeg/
Django Version: 1.0-final-SVN-unknown
Python Version: 2.5.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'tv.tvsite']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in root
  158. return self.model_page(request, *url.split('/', 2))
File "C:\Python25\lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in model_page
  177. return admin_obj(request, rest_of_url)
File "C:\Python25\Lib\site-packages\django\contrib\admin\options.py" in __call__
  197. return self.change_view(request, unquote(url))
File "C:\Python25\Lib\site-packages\django\db\transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "C:\Python25\Lib\site-packages\django\contrib\admin\options.py"
in change_view
  557. obj = model._default_manager.get(pk=object_id)
File "C:\Python25\Lib\site-packages\django\db\models\manager.py" in get
  93. return self.get_query_set().get(*args, **kwargs)
File "C:\Python25\Lib\site-packages\django\db\models\query.py" in get
  297. clone = self.filter(*args, **kwargs)
File "C:\Python25\Lib\site-packages\django\db\models\query.py" in filter
  483. return self._filter_or_exclude(False, *args, **kwargs)
File "C:\Python25\Lib\site-packages\django\db\models\query.py" in
_filter_or_exclude
  501. clone.query.add_q(Q(*args, **kwargs))
File "C:\Python25\Lib\site-packages\django\db\models\sql\query.py" in add_q
  1224. can_reuse=used_aliases)
File "C:\Python25\Lib\site-packages\django\db\models\sql\query.py" in add_filter
  1167. self.where.add((alias, col, field, lookup_type,
value), connector)
File "C:\Python25\Lib\site-packages\django\db\models\sql\where.py" in add
  48. params = field.get_db_prep_lookup(lookup_type, value)
File "C:\Python25\Lib\site-packages\django\db\models\fields\__init__.py"
in get_db_prep_lookup
  202. return [self.get_db_prep_value(value)]
File "C:\Python25\Lib\site-packages\django\db\models\fields\__init__.py"
in get_db_prep_value
  353. return int(value)

Exception Type: ValueError at /admin/tvsite/areas/1/areas/batzos.jpeg/
Exception Value: invalid literal for int() with base 10: '1/areas/batzos.jpeg'



2008/9/18 kelvin pompey <[EMAIL PROTECTED]>:
> Everything is being handled by the admin application.
>
> Environment:
>
> Request Method: GET
> Request URL:
> http://localhost:8000/admin/grades/student/1/photos/desktop.png/
> Django Version: 1.0-final-SVN-unknown
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'sgms.grades']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware')
>
>
> Traceback:
> File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
> get_response
>   86. response = callback(request, *callback_args,
> **callback_kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
> root
>   158. return self.model_page(request, *url.split('/', 2))
> File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in
> _wrapped_view_func
>   44. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
> model_page
>   177. return admin_obj(request, rest_of_url)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
> __call__
>   197. return self.change_view(request, unquote(url))
> File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
> _commit_on_success
>   238. res = func(*args, **kw)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
> change_view
>   557. obj = model._default_manager.get(pk=object_id)
> File "/usr/lib/python2.5/site-packages/django/db/models/manager.py" in get
>   93. return self.get_query_set().get(*args, **kwargs)
> File "/

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio

It happens inside the admin interface, so I've little control on It (AFAIK).
This what i have in my urls.py:

from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/(.*)', admin.site.root),
)

I've pasted a traceback on dpaste.com

2008/9/18 Ross <[EMAIL PROTECTED]>:
>
> The error looks like you are passing '1/photos/desktop.png' to int(),
> which converts a string to an integer. How are you creating the link
> to the picture?
>
> Your urls.py could be capturing that entire string and passing it as a
> parameter that you are trying to cast to an integer.
>
> A bigger stack trace would be easier to track down the problem.
>
> On Sep 18, 8:34 am, Picio <[EMAIL PROTECTED]> wrote:
>> I have the same issue, tried:
>> Django 1.0 with sqlite3 (Wiindows)
>> Django 1.0 with Mysql 5.0 (Windows)
>> Django 1.0 with sqlite3 (Mac OS X)
>>
>> Daniele
>>
>> 2008/9/18 silk.odyssey <[EMAIL PROTECTED]>:
>>
>>
>>
>> > I am using an imagefield from the admin interface. I can upload images
>> > without problems but when I click the link to view the image, I get
>> > the following error.
>>
>> > invalid literal for int() with base 10: '1/photos/desktop.png'
>>
>> > Any idea what's wrong? I am using django 1.0.
> >
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Everything is being handled by the admin application.

Environment:

Request Method: GET
Request URL:
http://localhost:8000/admin/grades/student/1/photos/desktop.png/
Django Version: 1.0-final-SVN-unknown
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'sgms.grades']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
root
  158. return self.model_page(request, *url.split('/', 2))
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in
_wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
model_page
  177. return admin_obj(request, rest_of_url)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
__call__
  197. return self.change_view(request, unquote(url))
File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
change_view
  557. obj = model._default_manager.get(pk=object_id)
File "/usr/lib/python2.5/site-packages/django/db/models/manager.py" in get
  93. return self.get_query_set().get(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in get
  297. clone = self.filter(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in filter
  483. return self._filter_or_exclude(False, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in
_filter_or_exclude
  501. clone.query.add_q(Q(*args, **kwargs))
File "/usr/lib/python2.5/site-packages/django/db/models/sql/query.py" in
add_q
  1224. can_reuse=used_aliases)
File "/usr/lib/python2.5/site-packages/django/db/models/sql/query.py" in
add_filter
  1167. self.where.add((alias, col, field, lookup_type, value),
connector)
File "/usr/lib/python2.5/site-packages/django/db/models/sql/where.py" in add
  48. params = field.get_db_prep_lookup(lookup_type, value)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py"
in get_db_prep_lookup
  202. return [self.get_db_prep_value(value)]
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py"
in get_db_prep_value
  353. return int(value)

Exception Type: ValueError at /admin/grades/student/1/photos/desktop.png/
Exception Value: invalid literal for int() with base 10:
'1/photos/desktop.png'

On Thu, Sep 18, 2008 at 9:47 AM, Ross <[EMAIL PROTECTED]> wrote:

>
> The error looks like you are passing '1/photos/desktop.png' to int(),
> which converts a string to an integer. How are you creating the link
> to the picture?
>
> Your urls.py could be capturing that entire string and passing it as a
> parameter that you are trying to cast to an integer.
>
> A bigger stack trace would be easier to track down the problem.
>
> On Sep 18, 8:34 am, Picio <[EMAIL PROTECTED]> wrote:
> > I have the same issue, tried:
> > Django 1.0 with sqlite3 (Wiindows)
> > Django 1.0 with Mysql 5.0 (Windows)
> > Django 1.0 with sqlite3 (Mac OS X)
> >
> > Daniele
> >
> > 2008/9/18 silk.odyssey <[EMAIL PROTECTED]>:
> >
> >
> >
> > > I am using an imagefield from the admin interface. I can upload images
> > > without problems but when I click the link to view the image, I get
> > > the following error.
> >
> > > invalid literal for int() with base 10: '1/photos/desktop.png'
> >
> > > Any idea what's wrong? I am using django 1.0.
> >
>

--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Ross

The error looks like you are passing '1/photos/desktop.png' to int(),
which converts a string to an integer. How are you creating the link
to the picture?

Your urls.py could be capturing that entire string and passing it as a
parameter that you are trying to cast to an integer.

A bigger stack trace would be easier to track down the problem.

On Sep 18, 8:34 am, Picio <[EMAIL PROTECTED]> wrote:
> I have the same issue, tried:
> Django 1.0 with sqlite3 (Wiindows)
> Django 1.0 with Mysql 5.0 (Windows)
> Django 1.0 with sqlite3 (Mac OS X)
>
> Daniele
>
> 2008/9/18 silk.odyssey <[EMAIL PROTECTED]>:
>
>
>
> > I am using an imagefield from the admin interface. I can upload images
> > without problems but when I click the link to view the image, I get
> > the following error.
>
> > invalid literal for int() with base 10: '1/photos/desktop.png'
>
> > Any idea what's wrong? I am using django 1.0.
--~--~-~--~~~---~--~~
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: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio

I have the same issue, tried:
Django 1.0 with sqlite3 (Wiindows)
Django 1.0 with Mysql 5.0 (Windows)
Django 1.0 with sqlite3 (Mac OS X)

Daniele

2008/9/18 silk.odyssey <[EMAIL PROTECTED]>:
>
> I am using an imagefield from the admin interface. I can upload images
> without problems but when I click the link to view the image, I get
> the following error.
>
> invalid literal for int() with base 10: '1/photos/desktop.png'
>
> Any idea what's wrong? I am using django 1.0.
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread silk.odyssey

I am using an imagefield from the admin interface. I can upload images
without problems but when I click the link to view the image, I get
the following error.

invalid literal for int() with base 10: '1/photos/desktop.png'

Any idea what's wrong? I am using django 1.0.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---