It helps! I'll check better for the encoding problems...
2007/1/30, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > 1. No, you can create a student with: Student.objects.create(name="Foo > Bar", school_id=2) > > 2. Not sure... I have a Django application here, and when I search for > "è", it returns the restaurant "Les Deux Frères" without problems. > Could be an encoding problem with your database or with your terminal > or with Python. That's the problem with encoding issues: they take a > lot of time to figure out and properly fix. > > Hope this helps. > > Vincent. > > On Jan 30, 7:56 am, "Sebastien Armand [Pink]" <[EMAIL PROTECTED]> > wrote: > > I've been trying Django and have 2 small problems: > > > > - When I have a foreign key field in a model, is it possible to use just > the > > id of the foreign object or do we always have to use the object itself? > > Example with a school and a student class. Each student has a foreign > key > > linking to the school where he studies. Through a form, I get the > > informations to create the student including the school's id. When I > want to > > create and save the student, am I obliged to first hit the database to > get > > the school object and then pass it to student(school=school_object) or > is > > there a way to just use the ID as it is? > > > > - When I search something in my database, using icontains on a field, it > > doesn't work when there are non-asccii characters: a product field may > > contain (in french so with accents!!) télévision but when I look for > "télé" > > I get a unicode error. If I look for "vision" everything works just > fine. > > Any idea why? > > > > Thanks > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---