On Tue, 22 Apr 2008 14:24:52 +0200
Enrico Morelli <[EMAIL PROTECTED]> wrote:

> 
> Dear all,
> 
> I'm new elixir user. I'm trying to port an application to elixir. I've
> two tables related by a many to many relationship:
> 
> class Projects(Entity):    
>     using_options(tablename='projects', autoload=True)
>     using_mapper_options(primary_key=['id_projects'])
>     
>     
> class Users(Entity):
>     using_options(tablename='users', autoload=True)
>     using_mapper_options(primary_key=['id_users'])
>     project = ManyToMany('Projects', 
>         tablename='users_projects',
>         local_side='id_users')
> 
> I'm able to add new projects to users, but when I remove a project I
> don't know how to remove the relation (if there is)  with the users.
> 
> If I use:
>  users=Users.query.filter(Users.project.any(project=prj)).all()
> 
> I obtain the list of users that has a relation with the project
> (prj) that I want to remove, but now?
> 
> Thanks for the suggestions.
> 

I solved myself.

Thanks

-- 
-------------------------------------------------------------------
       (o_
(o_    //\  Coltivate Linux che tanto Windows si pianta da solo.
(/)_   V_/_
+------------------------------------------------------------------+
|     ENRICO MORELLI         |  email: [EMAIL PROTECTED]       |
| *     *       *       *    |  phone: +39 055 4574269             |
|  University of Florence    |  fax  : +39 055 4574253             |
|  CERM - via Sacconi, 6 -  50019 Sesto Fiorentino (FI) - ITALY    |
+------------------------------------------------------------------+

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to