Ok,   so can you please tell me how I can make a class that
AutoIncrements the ID automatically whenever I need to make a new
record....  let me explain...

As I add records,  I want the ID to Auto Increment.   When you say
"define a constructor for your class which does not require an ID",
but I REQUIRE an ID,  I also require the ID to increment when I add
new record.   You went on to say "SQLALchemy has no constructor
requirements on mapped classes",  what do you mean by that?

Ok,  so can you give me some really simple SQLAlchemy code that would
allow me to increment the ID automatically?    Keep in mind,  that
multiple people may be adding records,  so it has to sort all this
out.

Am I to assume that this is beyond SQLAlchemy,  and no one else would
ever want to do this?   And this was never designed to do this?

I'm a really dumb newbee here,  so please be patient with me...

Thanx

On Feb 3, 7:38 am, "Michael Bayer" <[EMAIL PROTECTED]> wrote:
> jdcman wrote:
>
> > our members table has an ID as theprimarykeywith an auto-assigned
> >keyID.
>
> > When we create the class it is instantiated with the ID and also
> > returns an ID.
>
> > obviously if we provide an ID it conflicts with the auto-generated ID.
> > and if we don't provide an ID it says we didn't provide enough
> > variables to instantiate the class
> > so how do we define our class so that it can return an ID but doesn't
> > require one to instantiate the class?
>
> define a constructor for your class which does not require an id....or,
> don't define a constructor at all.  SQLAlchemy has no constructor
> requirements on mapped classes, that error is being produced by your own
> application.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to