Thanks for the hint. In the meantime I've imagined and successfully tried a system that uses sessions. When the user edits an invoice, a session variable is set to the invoiceID. According to the pseudocode You supplied, the user is redirected to the product management if the entered product doesn't exist. From there he searches for the product or creates a new product that he can pass to the invoice with the help of the invoiceID contained in the session. I don't know if it's good practice, but it seems to work.
Thank You again for all the precious help Marc On Jul 4, 11:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > As I mentioned some posts ago, I'm writing a managing system (front- > > and back-office) for the shop I own and I can't use the SingleSelect > > Field because it would contain about 16000 entries (products). > > That of course is to much for a SingleSelectField. > > > You mention "... incremental search ...". What is that? > > I meant that focussing a SingleSelectField and then pressing e.g. "g e r" will > point the field to "Germany" (if it happens to be part of the list of course) > > But again, for 16000 values that's not an option. > > > The user must also be able to enter a new text (the product code) not > > contained in the list of choices. The field accepts also entry from a > > barcode reader (I think that I should take some time at a later time > > to explain what I'm currently developing ... by the way, I feel that > > the final product might interest more people, but I'm not having the > > time to manage all the implication of publishing it. Any help at a > > later point will be absolutely appreciated) > > If that's your usecase, the ID you miss won't help you a bit. Because you can > only assign one if you have on - so you anyway need two code-paths to deal > with existing and new entries. > > Just do something like this (pseudo-code): > > def some_controller(self, completed_field=None, ...): > if Product.by_code(completed_field) is not None: > # work with an existing product > else: > # create a new one > > Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

