Re: migration via south for inheritance change -> please help

2012-07-09 Thread Daniel Walz
Hi Melvyn, 2012/7/9 Melvyn Sopacua : > On 9-7-2012 10:30, Daniel Walz wrote: > >> Ok, I did some tests today and read in the django sources. >> It seems to me, that an abstract model class has no Manager attached, >> at least not by default. > > Because an abstract model has no data. It is a colle

Re: migration via south for inheritance change -> please help

2012-07-09 Thread Melvyn Sopacua
On 9-7-2012 10:30, Daniel Walz wrote: > Ok, I did some tests today and read in the django sources. > It seems to me, that an abstract model class has no Manager attached, > at least not by default. Because an abstract model has no data. It is a collection of attribute definitions. > I see that,

Re: migration via south for inheritance change -> please help

2012-07-09 Thread Daniel Walz
Hi, 2012/7/7 Tomas Neme : >> and I do >> for fruit in Fruits.objects.all(): fruit.rott() >> >> will anything happen at all? I know in C++ this would work... ;-) >> >> on database-level I know how to do it, I just don't know if the django >> abstraction handles this automalically. > > I.. don't kno

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Tomas Neme
> and I do > for fruit in Fruits.objects.all(): fruit.rott() > > will anything happen at all? I know in C++ this would work... ;-) > > on database-level I know how to do it, I just don't know if the django > abstraction handles this automalically. I.. don't know. I'd think yes, at least I wonder o

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Daniel Walz
Hi again, 2012/7/7 Tomas Neme : >> The big difference is, -as I see it- I will not get real polymorphism, >> as the base class would need to do the join on all it's child classes. >> Is that true? > > with abstract models you won't get polymorphism at all, in the > database level (this is, you WON

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Tomas Neme
> The big difference is, -as I see it- I will not get real polymorphism, > as the base class would need to do the join on all it's child classes. > Is that true? with abstract models you won't get polymorphism at all, in the database level (this is, you WON'T be able to do Fruit.objects). You'

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Daniel Walz
Thanks guys for this helpfull discussion 2012/7/5 Tomas Neme : > [...] I assumed > he maybe doesn't know about abstract models because he said he's just > getting started programming (or at least on py/dj) and maybe he wasn't > sure what behavior he needed, and what were his options. ...although

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Tomas Neme
> Not really. But from the question: > "But how can I tell south to fill the super class with the data from the > old schema?" Well, in aswer to this, and Tom's remarks, you assumed he wanted to have a new table because he was asking how to populate it, I assumed he maybe doesn't know about abstra

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Melvyn Sopacua
On 5-7-2012 15:33, Tomas Neme wrote: > But I don't see how what you say makes sense. > > I mean, all the way starting from this: > >> No, you /should/ not. You may do this, but you will end up with two >> tables that /do not share the records/. >> From the OP's post it's obvious these classes sh

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Tom Evans
On Thu, Jul 5, 2012 at 2:33 PM, Tomas Neme wrote: > I wanted to chang the subject because I didn't want to spam someone's > plead for help into a design discussion, but then I thought, how am I > gonna make sure this is read by the right people? Also, context would > be lost, so.. sorry about this

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Tomas Neme
I wanted to chang the subject because I didn't want to spam someone's plead for help into a design discussion, but then I thought, how am I gonna make sure this is read by the right people? Also, context would be lost, so.. sorry about this But I don't see how what you say makes sense. I mean, al

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Melvyn Sopacua
On 4-7-2012 22:29, Tomas Neme wrote: > Besides that, if you don't want actual Base instances, then this is an > abstract class, and you should do this: > > class Base(models.Model): > eggs > plants > class Meta: > abstract=True > > class Foo(Base): > carpet=

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
By the way, if you do that, and I'm not crazy, you won't need to do any migration with south, since the Foo and Bar tables would both have all of base's columns (because Base is abstract). If Base can't be abstract (if you want Base instances that are neither Foo nor Bar), then you'll have to do t

RE: migration via south for inheritance change -> please help

2012-07-04 Thread Demian Brecht
On Behalf Of Lachlan Musicman Sent: Wednesday, July 04, 2012 1:18 PM To: django-users@googlegroups.com Subject: Re: migration via south for inheritance change -> please help I'd like to know this too - but I think the real answer is "get better at python" - you are essentially (f

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
You'll have to migrate your data manually in your migration, yes. Besides that, if you don't want actual Base instances, then this is an abstract class, and you should do this: class Base(models.Model): eggs plants class Meta: abstract=True class Foo(Base): carpet

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Lachlan Musicman
I'd like to know this too - but I think the real answer is "get better at python" - you are essentially (from what I can tell) in a django shell when south pops the "not blank, not null but no data" error - try pulling in some details from fixtures? cheers L. On Thu, Jul 5, 2012 at 2:30 AM, Danie

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Daniel Walz
...no one? regards, mcJack 2012/7/2 mcJack : > Hi all, > > I've got a problem migrating some changes in the model, so I tried to solve > it with south. > The situation: > I implemented two classes, which share some functionality. Now that I > improved a little with python, django and co. I wanted