21493 Posts in 5784 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1746 Views |
-
ModelAdmin (add member to group)

10 February 2010 at 2:56pm
I'm using $group->Members()->add($designer); to add users who register on the front end to the correct group. These designers (extension of Member class) are also managed through ModelAdmin. How would I have ModelAdmin add a new designer to the correct group when a new one is created?
-
Re: ModelAdmin (add member to group)

11 February 2010 at 12:16pm
Hi dendeffe,
could u pls post abit more code so that this a bit more transparent ?
-
Re: ModelAdmin (add member to group)

11 February 2010 at 1:48pm
Hi Teejay,
I have a Designer Class which extends Member. I have another Class RegisterPage which has this code:
It adds my newly created designer to the correct group. The designers are also editable in the backend through ModelAdmin. I don't have any idea of how to add the Designer to the correct group when I create one there. I can add a field that lists Group, but when I select one there, the Designer isn't added to the selected group.
-
Re: ModelAdmin (add member to group)

11 February 2010 at 2:25pm
maybe I am wrong but does the add method just relations ? when u add something it creates a relation entry in the db. Do u have a many_many relation to a designer in your group class ?
did u overwrite the belongs_many_many static of member ?
did u try $designer->write(); before u add it ??
-
Re: ModelAdmin (add member to group)

11 February 2010 at 10:23pm
Hmmm I haven't edited group, because it's a Class in Sapphire itself
-
Re: ModelAdmin (add member to group)

21 October 2010 at 10:26pm Last edited: 21 October 2010 10:35pm
Sorry to bump an old post, but did you ever solve this dendeffe?
-
Re: ModelAdmin (add member to group)

21 October 2010 at 11:04pm
Hi meganub,
wow, project from some way back. The code changed a few times on that. I ended up with this: http://www.sspaste.com/paste/show/4cc011bd8ec8c
The onAfterWrtite() links it to the right group.
| 1746 Views | ||
|
Page:
1
|
Go to Top |


