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
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
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
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
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
5 matches
Mail list logo