Re: Converting example from TG to Django

2006-06-05 Thread GinTon
class Genre(models.Model): name = models.CharField( maxlength=64, unique=True ) artists = models.ManyToManyField( 'Artist', null=True, blank=True ) class Admin: pass def __str__(self): return self.name class Artist(models.Model): name = models.CharField( maxlength=128

Re: Converting example from TG to Django

2006-06-05 Thread James Bennett
On 6/5/06, GinTon <[EMAIL PROTECTED]> wrote: > I can not create an Artist object without the existence of Genre and > Album objects > > Is there any way of make it? Add 'null=True, blank=True' to the 'genres' and 'albums' field, and you'll be able to create an artist without specifying any associ

Re: Converting example from TG to Django

2006-06-05 Thread GinTon
Honza Král wrote: > do you mean backward referencing?? > > http://www.djangoproject.com/documentation/db_api/#backward > that gets created for you > The API is really usefull! > if not, could you clarify what does not work for you? what would you > like to do and don't know how? > But in the admi

Re: Converting example from TG to Django

2006-06-05 Thread Honza Král
do you mean backward referencing?? http://www.djangoproject.com/documentation/db_api/#backward that gets created for you if not, could you clarify what does not work for you? what would you like to do and don't know how? On 6/5/06, GinTon <[EMAIL PROTECTED]> wrote: > > I'm trying to implement TG

Converting example from TG to Django

2006-06-05 Thread GinTon
I'm trying to implement TG example model as learning in Django. http://www.turbogears.org/docs/TurboTunes/ http://sqlobject.org/SQLObject.html#relationships-between-classes-tables To create relationships between tables are used: ForeignKey: One-to-Many MultipleJoin: One-to-Many (with back refere