Re: Meta inheritance across abstract base class

2014-11-26 Thread Collin Anderson
Hi,

Ohh. Yup. I didn't read that carefully enough. That behavior doesn't seem 
expected to me. Expecially considering this sentence:

"if the child does not specify an ordering attribute or a get_latest_by 
attribute, it will inherit these from its parent."

Collin

On Tuesday, November 25, 2014 9:27:31 AM UTC-5, Torsten Bronger wrote:
>
> Hallöchen! 
>
> Collin Anderson writes: 
>
> > If you define a new class Meta on C, then it will _replace_ the 
> > previous class Meta. [...] 
>
> I indeed have a Meta class in C but it is derived from the upstream 
> Meta class.  The inheritance chain in my Meta's is uninterrupted. 
>
> Tschö, 
> Torsten. 
>
> -- 
> Torsten BrongerJabber ID: torsten...@jabber.rwth-aachen.de 
>  
>   or http://bronger-jmp.appspot.com 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35de7fdc-9be4-4d14-8644-8b60a3b10bef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Meta inheritance across abstract base class

2014-11-25 Thread Torsten Bronger
Hallöchen!

Collin Anderson writes:

> If you define a new class Meta on C, then it will _replace_ the
> previous class Meta. [...]

I indeed have a Meta class in C but it is derived from the upstream
Meta class.  The inheritance chain in my Meta's is uninterrupted.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/878uizqs1j.fsf%40physik.rwth-aachen.de.
For more options, visit https://groups.google.com/d/optout.


Re: Meta inheritance across abstract base class

2014-11-25 Thread Collin Anderson
Hi,

If you define a new class Meta on C, then it will _replace_ the previous 
class Meta. You can, however have class Meta inherit other class Meta.
class Student(CommonInfo):
# ...
class Meta(CommonInfo.Meta):
db_table = 'student_info'

https://docs.djangoproject.com/en/dev/topics/db/models/#meta-inheritance

Collin


On Monday, November 24, 2014 8:19:50 AM UTC-5, Torsten Bronger wrote:
>
> Hallöchen! 
>
> I have the following model structure: 
>
> class A(models.Model): 
> ... 
> class Meta: 
> ordering = ["timestamp"] 
> get_latest_by = "timestamp" 
>
> class B(A): 
> class Meta(A.Meta): 
> abstract = True 
>
> class C(B): 
> ... 
>
> Then, class C doesn't haven ordering or get_latest_by set.  Is this 
> expected behaviour?  Then, I would simply re-define them in B. 
>
> Tschö, 
> Torsten. 
>
> -- 
> Torsten BrongerJabber ID: torsten...@jabber.rwth-aachen.de 
>  
>   or http://bronger-jmp.appspot.com 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ae594b2d-caba-4e4a-91ba-f840bf9f5781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Meta inheritance across abstract base class

2014-11-24 Thread Torsten Bronger
Hallöchen!

I have the following model structure:

class A(models.Model):
...
class Meta:
ordering = ["timestamp"]
get_latest_by = "timestamp"

class B(A):
class Meta(A.Meta):
abstract = True

class C(B):
...

Then, class C doesn't haven ordering or get_latest_by set.  Is this
expected behaviour?  Then, I would simply re-define them in B.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/87h9xospms.fsf%40physik.rwth-aachen.de.
For more options, visit https://groups.google.com/d/optout.