> I tried to insert, as you have said to me, but have received this error:

> line 124, in get_all_related_objects
>     if f.rel and self == f.rel.to._meta:
> AttributeError: 'str' object has no attribute '_meta'

I guess you have quotes around the name of the class, so that the
Referenced
class is really a string that does not have '_meta' attribute.

I tried what suggested, i.e to import the class from where is is
defined but
I met another problem. I've got  a 'Film' model Class and a proposed_by
field that should reference django User, so in models.py I did:

from django.contrib.auth.models import User

(...)

class Film(models.Model):
   ...
   proposto_da = models.ForeignKey(User, blank=True)

When I try to edit with the admin interfaces django raises an error:

Exception Type:         OperationalError
Exception Value:        no such column: film_film.proposto_da_id

Why does it look for film_film.proposto_da_id. Of course this is not a
valid
name!
The sqlite schema seems correct:

CREATE TABLE "film_film" (
    "id" integer NOT NULL PRIMARY KEY,
    "titolo" varchar(100) NOT NULL,
    "regista" varchar(40) NOT NULL,
    "url_iann" varchar(200) NOT NULL,
    "url_altri" varchar(200) ,
    "anno" integer NOT NULL,
    "image" varchar(100) NOT NULL,
    "durata" integer NOT NULL,
    "genere_id" integer NOT NULL REFERENCES "film_genere" ("id"),
    "data_proiezione" date,
    "proposto_da" integer REFERENCES "auth_user" ("id")
);
CREATE INDEX film_film_genere_id ON "film_film" ("genere_id");


Any help is appreciated!
Thanks


sandro
*:-)


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

Reply via email to