Re: ValueError: invalid literal for int() with base 10: '42596/img/admin/icon_calendar.gif'

2009-09-01 Thread ANIL KARADAĞ
2009/9/1 Daniel Roseman <dan...@roseman.org.uk>

>
> On Sep 1, 12:17 pm, ANIL KARADAĞ <anil.kara...@gmail.com> wrote:
> > 2009/9/1 Daniel Roseman <dan...@roseman.org.uk>
> >
> > > On Sep 1, 10:35 am, ANIL KARADAĞ <anil.kara...@gmail.com> wrote:
> > > > hello everbody,
> >
> > > > i have en error for a week. i did not resolve and i did not find it's
> > > > solution.
> >
> > > > Sometimes system is sent an error:
> >
> > > > File
> > > "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py",
> > > > line 353, in get_db_prep_value
> > > >return int(value)
> >
> > > > ValueError: invalid literal for int() with base 10:
> > > > '42596/img/admin/icon_calendar.gif'
> >
> > > > 42596 is a product id and
> >
> > > >  'HTTP_REFERER':
> > > > 'http://example.com./admin/product/product/42596/<
> > >http://www.emall.com.tr/admin/product/product/42596/>
> > > > ',
> > > >  'SCRIPT_URI': '
> > >http://example.com/admin/product/product/42596/img/admin/icon_calenda..
> .<
> > >http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca..
> .>
> > > > ',
> >
> > > > icon_calender.gif is under admin_media and trust url ishttp://
> > > example.com/admin/media/img/admin/icon_calendar.gif/<
> > >http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca..
> .>
> > > > '
> >
> > > > anyone know why system is not used to trust url?
> >
> > > > --
> > > > Anıl KARADAĞ
> > > > Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
> > > > GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisihttp://
> > > anilkaradag.info/blog
> >
> > > I have seen this, and have attempted to track it down. It seems to be
> > > caused by some Javascript. Can you tell me if you are using TinyMCE on
> > > that page? And which browser are you using?
> >
> > yes, we use tinymce and i use firefox 3.5 candidate 3
> >
> > thank you
>
> Thanks, that confirms my suspicions - that's exactly the setup I am
> seeing the problem with. I believe there is some sort of conflict
> between Firefox 3.5 and the TinyMCE javascript.
>
> What seems to be happening is that TinyMCE injects various scripts
> into the DOM. For some reason, in Firefox 3.5 this causes
> document.getElementsByTagName('script') to no longer return the full
> list of scripts in the DOM. Django's DateTimeShortcuts.js script uses
> this list to work out its own source path (which it uses to find the
> path to the admin icons), but now can no longer find itself in that
> list, so fails.
>
> This is really a bug either in Firefox or in TinyMCE, but could
> probably be averted if Django had a better way for js files to get the
> value of ADMIN_MEDIA_PREFIX. Not sure if this has been addressed in
> the recent Google Summer of Code project to rewrite the admin
> javascript.
>


hi Daniel, i think your opinion is right. i looked some error logs(relevent
to subject), their client agent is:

'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.1.2)
Gecko/20090729 Firefox/3.5.2',

Now, i did definition of tinymce to comment line. i am continue searching

thank you very much

regards,


> --
> DR.
> >
>


-- 
Anıl KARADAĞ
Cihan Information S.C. - Software Development Engineer
GYTE- Computer Engineer. - Master student
http://anilkaradag.info/blog

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: ValueError: invalid literal for int() with base 10: '42596/img/admin/icon_calendar.gif'

2009-09-01 Thread ANIL KARADAĞ
2009/9/1 Daniel Roseman <dan...@roseman.org.uk>

>
> On Sep 1, 10:35 am, ANIL KARADAĞ <anil.kara...@gmail.com> wrote:
> > hello everbody,
> >
> > i have en error for a week. i did not resolve and i did not find it's
> > solution.
> >
> > Sometimes system is sent an error:
> >
> > File
> "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py",
> > line 353, in get_db_prep_value
> >return int(value)
> >
> > ValueError: invalid literal for int() with base 10:
> > '42596/img/admin/icon_calendar.gif'
> >
> > 42596 is a product id and
> >
> >  'HTTP_REFERER':
> > 'http://example.com./admin/product/product/42596/<
> http://www.emall.com.tr/admin/product/product/42596/>
> > ',
> >  'SCRIPT_URI': '
> http://example.com/admin/product/product/42596/img/admin/icon_calenda...<
> http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca...>
> > ',
> >
> > icon_calender.gif is under admin_media and trust url ishttp://
> example.com/admin/media/img/admin/icon_calendar.gif/<
> http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca...>
> > '
> >
> > anyone know why system is not used to trust url?
> >
> > --
> > Anıl KARADAĞ
> > Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
> > GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisihttp://
> anilkaradag.info/blog
>
> I have seen this, and have attempted to track it down. It seems to be
> caused by some Javascript. Can you tell me if you are using TinyMCE on
> that page? And which browser are you using?
>

yes, we use tinymce and i use firefox 3.5 candidate 3

thank you



> --
> DR.
> >
>


-- 
Anıl KARADAĞ
Cihan Information S.C. - Software Development Engineer
GYTE- Computer Engineer. - Master student
http://anilkaradag.info/blog

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ValueError: invalid literal for int() with base 10: '42596/img/admin/icon_calendar.gif'

2009-09-01 Thread ANIL KARADAĞ
hello everbody,

i have en error for a week. i did not resolve and i did not find it's
solution.

Sometimes system is sent an error:

File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py",
line 353, in get_db_prep_value
   return int(value)

ValueError: invalid literal for int() with base 10:
'42596/img/admin/icon_calendar.gif'

42596 is a product id and

 'HTTP_REFERER':
'http://example.com./admin/product/product/42596/
',
 'SCRIPT_URI': '
http://example.com/admin/product/product/42596/img/admin/icon_calendar.gif/
',

icon_calender.gif is under admin_media and trust url is
http://example.com/admin/media/img/admin/icon_calendar.gif/
'

anyone know why system is not used to trust url?

-- 
Anıl KARADAĞ
Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisi
http://anilkaradag.info/blog

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Call a custom python function during each model save

2009-09-01 Thread ANIL KARADAĞ
you can override model save method:

for example

class Student(models.Model):
name = models.CharField(blabla)

def save(self, *force_insert=False*, *force_update=False*):
# call spesific python method
# operations
super(Student, self).save(force_insert=force_insert,
force_update=force_update)


2009/9/1 Harish 

>
> Hi Friends,
>
> I want to call a python function, while saving each model... How can I
> do this?
>
> For example I have many application in a project
> I have field in each model of the application and  I have to access
> the field just before the any model object is saved and alter a value
> of that field. Here I can use save_model() function, but I want to
> write a function once and each time when the model is saved that
> function should be called
>
> Any Idea for this...
>
>
> Regards
> Harish Bhat M
> >
>


-- 
Anıl KARADAĞ
Cihan Information S.C. - Software Development Engineer
GYTE- Computer Engineer. - Master student
http://anilkaradag.info/blog

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---