Changes between Version 14 and Version 15 of CompositePrimaryKeyDesignNotes


Ignore:
Timestamp:
Sep 1, 2012, 11:42:16 PM (12 years ago)
Author:
Ben Finney
Comment:

structure the page

Legend:

Unmodified
Added
Removed
Modified
  • CompositePrimaryKeyDesignNotes

    v14 v15  
    55== Design Questions ==
    66
    7 * ''How do you define multiple primary keys?''
     7=== How do you define multiple primary keys? ===
    88
    9   The "neatest" solution would be to allow primary_key=True on multiple fields but this may be precluded by other design considerations.
     9The "neatest" solution would be to allow primary_key=True on multiple fields but this may be precluded by other design considerations.
    1010
    11 * ''How do you foreign key onto a table with a composite foreign key?''
     11=== How do you foreign key onto a table with a composite foreign key? ===
    1212
    13   The primary key is a set of the columns.
     13The primary key is a set of the columns.
    1414
    15 * ''What do you use for .get(pk=foo) with a composite primary key?''
     15=== What do you use for .get(pk=foo) with a composite primary key? ===
    1616
    17   The primary key is a set of the columns.
     17The primary key is a set of the columns.
    1818
    19   The likely solution is to use a set, though there is mention of the comment framework overlapping with this.
     19There is mention of the comment framework overlapping with this.
    2020
    21 * ''How does Admin map a url to an object?''
     21=== How does Admin map a url to an object? ===
    2222
    23   Possible solutions (for a key with the value {{{ { val_foo, val_bar, val_baz } }}}:
     23Possible solutions (for a key with the value {{{ { val_foo, val_bar, val_baz } }}}:
    2424
    25   * {{{/appname/modulename/val_foo,val_bar,val_baz/}}}
     25* {{{/appname/modulename/val_foo,val_bar,val_baz/}}}
    2626
    27     How to deal with values containing commas? Should be able to be handled with some nice url escaping.
     27  How to deal with values containing commas? Should be able to be handled with some nice url escaping.
    2828
    29   * {{{/appname/modulename/val_foo/val_bar/val_baz/}}}
     29* {{{/appname/modulename/val_foo/val_bar/val_baz/}}}
    3030
    31 * ''The columns of a key are a set, and have no implicit order. How to deal with identity between different orders of the same set?''
     31=== How to deal with identity between different orders of the same set? ===
     32
     33The columns of a key are a set, and have no implicit order. This means the key {{{ { val_foo, val_bar, val_baz } }}} is identical to {{{ { val_baz, val_foo, val_bar } }}} and so on for all permutations. How should URLs be parsed to reflect this identity?
    3234
    3335== Affected Areas ==
     
    5759Expect there is a large amount of work in here making sure all the model inspection and form generation works.
    5860
    59 Url to object mapping.
     61URL to object mapping.
    6062
    6163=== Serialization ===
Back to Top