Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 June 14, 2010 16:39:34

Jeff G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin error with large charField


In one of my models, I have a CharField with Max_length of 2000
characters.
When I try to delete the record via admin, I get an error value too
long for type character varying(200).

It seems that the issue is because it is trying to insert the record
into the django_admin_log and the change_message field is defined as a
TextField which has a limit of 200 characters.

Any suggestions on how to get around this issue.

Thanks,
Jeff

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 14, 2010 17:50:57

Karen T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin error with large charField


On Mon, Jun 14, 2010 at 11:39 AM, Jeff Green <jeffhg2...@gmail.com> wrote:

> In one of my models, I have a CharField with Max_length of 2000
> characters.
> When I try to delete the record via admin, I get an error value too
> long for type character varying(200).
>
> It seems that the issue is because it is trying to insert the record
> into the django_admin_log and the change_message field is defined as a
> TextField which has a limit of 200 characters.
>
> Any suggestions on how to get around this issue.
>

This has been reported before, see:http://code.djangoproject.com/ticket/10523http://code.djangoproject.com/ticket/10632Trouble is we can't, in general, recreate it. The code in question already
truncates the object_repr for the log message to 200 characters, see:http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/contrib/admin/models.py#L14So it is a bit of a mystery why some people run into a problem where the
repr apparently has not been cut down to a size that will fit. If you could
trace through the code on your system where you see the problem and shed any
light on how this is happening, that would be helpful. Alternatively if you
could post very specific details of your model, Python version, database
version, etc. to ticket #10523 then maybe someone will be able to recreate
and figure out what is going on.

Karen
--http://tracey.org/kmt/--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 14, 2010 20:32:07

Jeff G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin error with large charField


I was able to trace the cause of the error, though not sure if this was the
cause with other people.
I loaded my data from an excel spreadsheet which copied a table from
microsoft word.

It seems that the copy from word puts some special characters in the
database.

I was able to manually type in the text with more than 200 characters and I
was able to delete the record successfully. I have put in the details for my
scenario in ticket #10523

Jeff

On Mon, Jun 14, 2010 at 11:50 AM, Karen Tracey <kmtra...@gmail.com> wrote:

> On Mon, Jun 14, 2010 at 11:39 AM, Jeff Green <jeffhg2...@gmail.com> wrote:
>
>> In one of my models, I have a CharField with Max_length of 2000
>> characters.
>> When I try to delete the record via admin, I get an error value too
>> long for type character varying(200).
>>
>> It seems that the issue is because it is trying to insert the record
>> into the django_admin_log and the change_message field is defined as a
>> TextField which has a limit of 200 characters.
>>
>> Any suggestions on how to get around this issue.
>>
>
> This has been reported before, see:
>
>http://code.djangoproject.com/ticket/10523>http://code.djangoproject.com/ticket/10632>
> Trouble is we can't, in general, recreate it. The code in question already
> truncates the object_repr for the log message to 200 characters, see:
>
>
>http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/contrib/admin/models.py#L14>
> So it is a bit of a mystery why some people run into a problem where the
> repr apparently has not been cut down to a size that will fit. If you could
> trace through the code on your system where you see the problem and shed any
> light on how this is happening, that would be helpful. Alternatively if you
> could post very specific details of your model, Python version, database
> version, etc. to ticket #10523 then maybe someone will be able to recreate
> and figure out what is going on.
>
> Karen
> --
>http://tracey.org/kmt/>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 13th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support