rhet wrote:
> I've recently run into a problem where the admin generated code by
> symfony isn't able to overcome. Essentially I have an article table
> and a user table. I have a foreign key in the article table called
> user_id that's related to the user table.
>
> The user table has grown over 15,000 rows quickly. Making my edit view
> of the article page load in 5-6 seconds because it creates a select
> menu based on the user object. Keep in mind this is all using the init-
> admin code symfony creates for me. So the foreign key relationship
> creates a 15,000 options long select menu.
>
>  To solve the problem I created a partial called _user_id.php in which
> I use input_auto_complete_tag() to pull the users from the database
> based on the admins typed keys. I then override the executeEdit
> function that symfony creates and use a retreiveByUsername method to
> retrieve the user based on the typed username. Finally I stuff the
> user_id with the found username in the action before saving.
>
> My question is this: Do you agree with my method? What would you do
> different? Anyone else have experience with LARGE foreign key
> relationships where select menus just don't work, if so how did you
> handle?
>
> Thanks
> Rhet
>
>
> >
>
>   
For me you did the best. What I would enhance it with is autocomplete on 
the user field so when you type the username you can get results from 
the database table so that you can enhance the experience.

Kupo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to