|
It's that "fundamental change-of-mind" that you speak of that I'm
advocating. =) billf wrote: In SQL, a table can only have one primary key. Web2py insists that the primary key of every table is 'id' and 'id' alone. So without a fundamental change-of-mind I don't see how a complex primary key can be supported in web2py.That said, SQL supports multiple UNIQUE keys, both single and multi column. The PRIMARY key is just a special case of UNIQUE. I believe that web2py already supports single column unique constraints. It is multi-column unique constraints that I want to add to the DAL (although they can already be created by native SQL and executesql()). Requires/validators work as form validation rather than database configuration but I suppose there is is nothing to stop IS_NOT_IN_DB statements being used to create db constraints in addition to specifying a validator. On Dec 16, 2:59 pm, Timothy Farrell <[email protected]> wrote:In the thread on validating multiple fields, I was trying to use validators to get around the problem of lack of complex primary key support. The better solution is to have true complex primary key support rather than a validator that scaffolds this restriction only when using SQLHTML helpers. My design philosophy difference with Massimo that I mentioned is that validators should be used in the DAL for updating and inserting rather than creating the impression of a true restriction that only really exists if you use the SQLHTML helpers. For a DAL to be a true DAL, it needs to support a reasonable subset of the databases it abstracts. That's what Bill and I are proposing here (Bill stop me if I'm putting words in your mouth). Complex primary keys and the multi-field uniqueness restriction go hand-in-hand. They are very nearly the same thing but more importantly they pave the way for restrictions to be handled by the DAL and not (necessarily only) the SQLHTML helpers. Is that more clear? -tim DenesL wrote:Tim, wasn't this resolved in a recent thread?. Is your definition of "Complex Primary keys" different from that?. Just trying to understand... On Dec 16, 9:19 am, Timothy Farrell<[email protected]>wrote:Bill, I'm with you. Complex Primary keys is tops on my wishlist right now. Part of the reason I wanted a web2py wiki so much is so we could do stuff like this in PEP style. For those unfamiliar with PEPs:http://www.python.org/dev/peps/pep-0001/I'm over at the wiki, starting a WEP section. -tim-- Timothy Farrell<[email protected]>Computer Guy Statewide General Insurance Agency (www.swgen.com) -- Timothy Farrell <[email protected]> Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~--- |
- [web2py:13627] Indices/constraints and the DAL billf
- [web2py:13637] Re: Indices/constraints and the DAL Fran
- [web2py:13642] Re: Indices/constraints and the DA... Timothy Farrell
- [web2py:13643] Re: Indices/constraints and the DAL Timothy Farrell
- [web2py:13645] Re: Indices/constraints and the DA... DenesL
- [web2py:13649] Re: Indices/constraints and th... mdipierro
- [web2py:13650] Re: Indices/constraints and th... Timothy Farrell
- [web2py:13652] Re: Indices/constraints an... billf
- [web2py:13653] Re: Indices/constrain... Timothy Farrell
- [web2py:13654] Re: Indices/constraints an... billf

