Re: django workaround for multiple primary keys or sqlalchemy

2013-07-30 Thread Tom Evans
On Mon, Jul 29, 2013 at 10:04 PM, Bill Freeman wrote: > Its not clear to me whether unique_together will make there be an index, so > it might be slow. unique_together implies a multi part index - it's the only way it could be reasonably implemented. Cheers Tom -- You received this message be

Re: django workaround for multiple primary keys or sqlalchemy

2013-07-29 Thread Guy Tamir
ce for a situation i've got. >> >> I'm working on a new project and after designing my ERD I know i need a >> few tables to have multiple primary keys and one table with triple primary >> keys. >> >> after reading about the subject online i found out tha

Re: django workaround for multiple primary keys or sqlalchemy

2013-07-29 Thread Bill Freeman
ny 3rd party Django apps as well. > > On Monday, July 29, 2013 11:39:20 AM UTC-4, Guy Tamir wrote: >> >> Hi all, >> >> i'm fairly new to Django and i have a question regarding the best >> practice for a situation i've got. >> >> I'm wo

Re: django workaround for multiple primary keys or sqlalchemy

2013-07-29 Thread Justin Michalicek
ituation i've got. > > I'm working on a new project and after designing my ERD I know i need a > few tables to have multiple primary keys and one table with triple primary > keys. > > after reading about the subject online i found out that Django does not > s

django workaround for multiple primary keys or sqlalchemy

2013-07-29 Thread Guy Tamir
Hi all, i'm fairly new to Django and i have a question regarding the best practice for a situation i've got. I'm working on a new project and after designing my ERD I know i need a few tables to have multiple primary keys and one table with triple primary keys. after reading ab

Re: Multiple Primary Keys

2010-03-17 Thread Ramiro Morales
On Wed, Mar 17, 2010 at 12:21 PM, ojayred wrote: > Hello Users, > > I am new to using Django and so far, I like it. I have installed > Django and want to use it with a pre-existing database. Several tables > have multiple primary keys. How do I create the multiple primary keys &g

Multiple Primary Keys

2010-03-17 Thread ojayred
Hello Users, I am new to using Django and so far, I like it. I have installed Django and want to use it with a pre-existing database. Several tables have multiple primary keys. How do I create the multiple primary keys in the model? I did use the inspectdb command to help me create the model

Re: Multiple primary keys

2007-09-05 Thread Lars Stavholm
retty nice) URL scheme used today. So I'd say: yes there's reason to worry about *how* to support multiple primary keys (including arbitrary string keys), but there's no reason what-so-ever not to implement it. The multiple primary key feature would open up for loads of legacy databas

Re: Multiple primary keys

2007-09-04 Thread Leo
Lars, have you made any progress on this? I agree that only the numeric types are interesting as multiple keys, so worrying about URL encoding is pointless (i.e., there's no reason to worry about supporting multiple arbitrary-string keys). I'm trying to convince a team to use Django for new deve

Re: Multiple primary keys

2007-08-14 Thread Lars Stavholm
have to deal with the admin URLs at all. > > - it does not deal with creating databases or database introspection. > > For a model with multiple primary keys, add an Meta class attribute > `has_composite_primary_key_key=True`. Here's an example model with > multiple prima

Re: Multiple primary keys

2007-08-14 Thread Russell Keith-Magee
On 8/14/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Periodically, I wonder if it's worth implementing this anyway, just for > fun, and then saying if you have multiple primary keys, you can't use > those models in the admin. No need to ban _all_ multiple p

Re: Multiple primary keys

2007-08-14 Thread Michael Radziej
the project, so you have to maintain it on your own - it doesn't try to work for the admin or for newforms (but made be working for it), so I didn't have to deal with the admin URLs at all. - it does not deal with creating databases or database introspection. For a model with multiple

Re: Multiple primary keys

2007-08-13 Thread Lars Stavholm
t;>> you have multiple column primary keys, this isn't so easy to do. To >>>> date, every proposed syntax for URL spaces supporting multiple primary >>>> keys has either been syntactically ambiguous (e.g., >>>> /path/to/object/42,37 - which works unl

Re: Multiple primary keys

2007-08-13 Thread Malcolm Tredinnick
t so easy to do. To > >> date, every proposed syntax for URL spaces supporting multiple primary > >> keys has either been syntactically ambiguous (e.g., > >> /path/to/object/42,37 - which works unless the primary key has a comma > >> in it), or very inelegant (/path

Re: Multiple primary keys

2007-08-13 Thread Lars Stavholm
path/to/object/42/ -> edit object 42 >> >> This works fine if you have a single column primary key; however, if >> you have multiple column primary keys, this isn't so easy to do. To >> date, every proposed syntax for URL spaces supporting multiple primary >> ke

Re: Multiple primary keys

2007-08-13 Thread Malcolm Tredinnick
works fine if you have a single column primary key; however, if > you have multiple column primary keys, this isn't so easy to do. To > date, every proposed syntax for URL spaces supporting multiple primary > keys has either been syntactically ambiguous (e.g., > /path/to/object/42,37 -

Re: Multiple primary keys

2007-08-13 Thread Russell Keith-Magee
ication and generic views. Both of these features rely upon the ability to install URLs like: /path/to/object/42/ -> edit object 42 This works fine if you have a single column primary key; however, if you have multiple column primary keys, this isn't so easy to do. To date, every proposed sy

Multiple primary keys

2007-08-13 Thread Lars Stavholm
Hi all, first of all: django rocks! I'm a database application developer and not a web developer. I'm not even fluent in python. Despite that, the django framework has made it possible for me to develop web based database applications with relative ease. And, I can use the model and the database

Re: Re: inspect and multiple primary keys

2006-10-19 Thread Russell Keith-Magee
On 10/19/06, flynnguy <[EMAIL PROTECTED]> wrote: > > Yes, but don't I still need to specify a primary key in django? Yes you do, but you can nominate any field in your model as the primary key - you don't have to use 'id'. If you add a primary_key=True argument to the definition of any field, it

Re: inspect and multiple primary keys

2006-10-19 Thread flynnguy
Russell Keith-Magee wrote: > However, as suggested in the ticket, you can work around the problem > by hand writing the schema yourself (or, in your case, inheriting some > schema from elsewhere), then writing a Django model that replicates > everything in your schema _except_ the mutliple primary

Re: inspect and multiple primary keys

2006-10-18 Thread Russell Keith-Magee
ke > the ability to use the admin console. Does anyone have any suggestions? Django doesn't currently have support for multiple primary keys, and as far as I know, nobody is really looking at the problem. However, as suggested in the ticket, you can work around the problem by hand writ

inspect and multiple primary keys

2006-10-18 Thread flynnguy
I'm trying to inspect my db for mythtv. I'm running into issues with the inspect command because of the 0 date issue, not a problem, I'm just creating the models I need by hand. The issue I am currently running into is the recorded table has two primary keys (chanid and starttime). In searching I