Changes between Version 14 and Version 15 of CompositePrimaryKeyDesignNotes
- Timestamp:
- Sep 1, 2012, 11:42:16 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompositePrimaryKeyDesignNotes
v14 v15 5 5 == Design Questions == 6 6 7 * ''How do you define multiple primary keys?'' 7 === How do you define multiple primary keys? === 8 8 9 The "neatest" solution would be to allow primary_key=True on multiple fields but this may be precluded by other design considerations.9 The "neatest" solution would be to allow primary_key=True on multiple fields but this may be precluded by other design considerations. 10 10 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? === 12 12 13 The primary key is a set of the columns.13 The primary key is a set of the columns. 14 14 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? === 16 16 17 The primary key is a set of the columns.17 The primary key is a set of the columns. 18 18 19 The likely solution is to use a set, though there is mention of the comment framework overlapping with this.19 There is mention of the comment framework overlapping with this. 20 20 21 * ''How does Admin map a url to an object?'' 21 === How does Admin map a url to an object? === 22 22 23 Possible solutions (for a key with the value {{{ { val_foo, val_bar, val_baz } }}}:23 Possible solutions (for a key with the value {{{ { val_foo, val_bar, val_baz } }}}: 24 24 25 * {{{/appname/modulename/val_foo,val_bar,val_baz/}}}25 * {{{/appname/modulename/val_foo,val_bar,val_baz/}}} 26 26 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. 28 28 29 * {{{/appname/modulename/val_foo/val_bar/val_baz/}}}29 * {{{/appname/modulename/val_foo/val_bar/val_baz/}}} 30 30 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 33 The 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? 32 34 33 35 == Affected Areas == … … 57 59 Expect there is a large amount of work in here making sure all the model inspection and form generation works. 58 60 59 U rlto object mapping.61 URL to object mapping. 60 62 61 63 === Serialization ===