On 11 déc, 01:11, pielgrzym <[EMAIL PROTECTED]> wrote:
(snip)
> The problem with saving is that when I try to save a post instance I
> recieve:
>
> AttributeError: 'TagField' object has no attribute '_meta'
> (link to full error report:http://wklej.org/hash/098a9cbd7a/)
>
> I'm not sure if passing 'self' as content object isn't the reason,

It is, clearly. You're passing a Field object ('self') where a Model
object is expected. It's not the TagField you want to pass but the
Model instance it's bound to. Which should probably be done in pre_save
() - which gets the instance as parm -, not in get_db_prep_value().

For the record and if I may ask : did you investigate solving your
initial problem with the existing tagging app and urllib.quote
instead ?

Also and FWIW : the existing tagging app (just like Django and Python)
is free software. This means that you have the right to read, modify
and redistribute the source code. If tagging is quite close but not
exactly what you want, why don't you start with the existing source
code and improve / taylor to your needs ?


> yet
> I have no idea how to achieve this :(

You could have a look at how tagging implemented TagField, and/or at
django/db/models/fields/__init__.py. Reading the source is most of the
time the best way to understand how something works !-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to