Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Extending existing models (specifically Photologue) [RSS Feed]

#1 March 25, 2008 15:19:06

O.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Extending existing models (specifically Photologue)


Hello there. I get the impression, after reading the Auth / User stuff
that comes with Django, extending models is not the best way of adding
functionality. I've been using photologue for my e-commerce project.
I'd like to extend Photo and Gallery but I seem to be hitting a lot of
errors here and there. I suspect its not quite as simple as simply
extending the model:

from django.db import models
from contact.models import Contact
from photologue.models import Gallery
from django.contrib.auth.models import User


class Portfolio(Gallery):
css_style = models.TextField()
owner = models.ForeignKey(User, unique=True, blank=False, null=False)

class Admin:
list_display = ('title','pub_date','owner')
list_filter =
ordering =

I guess this probably wont work very well. The admin side certainly
complains though the database model looks fine to be fair. Is there
something im missing here or should i just create another class based
on models.Model and implement a foreignkey relationship
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 25, 2008 15:28:12

Malcolm T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Extending existing models (specifically Photologue)


On Tue, 2008-03-25 at 07:18 -0700, Oni wrote:
> Hello there. I get the impression, after reading the Auth / User stuff
> that comes with Django, extending models is not the best way of adding
> functionality. I've been using photologue for my e-commerce project.
> I'd like to extend Photo and Gallery but I seem to be hitting a lot of
> errors here and there. I suspect its not quite as simple as simply
> extending the model:
>
> from django.db import models
> from contact.models import Contact
> from photologue.models import Gallery
> from django.contrib.auth.models import User
>
>
> class Portfolio(Gallery):

Stop right there. Model inheritance is NOT supported in trunk. It will
be soon, but it is not supported right now. It's not a trivial thing, so
it has taken some time and effort to get right.

Regards,
Malcolm

--
Quantum mechanics: the dreams stuff is made of.http://www.pointy-stick.com/blog/--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

  • Root
  • » Django
  • » Extending existing models (specifically Photologue) [RSS Feed]

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support