On 28 sep, 11:43, mf <mf2...@gmail.com> wrote:
> After finishing the core functionalities of my project it's time to
> begin with other secundary but important things.
>
> I've something like the following models.py file:
>
> class Category(models.Model):
>    name = models.CharField(max_length=30)
>
> class Transaction(models.Model):
>     name = models.CharField(max_length=30)
>     description = models.TextField(blank=True)
>     amount = models.DecimalField(max_digits=12, decimal_places=2)
>     category = models.ForeignKey(Category,
> related_name='transacciones', blank=True, null=True)
>
> And this is what I want to do:
>
>  Accounts: Each user can create different accounts.Example: the user A
> have a home account with categories car and house, and a work account
> with categories salary and bonuses. I don't know how to explain it
> well, I'd like to have a "group of rows" for each account.
>
> It seems pretty easy to do but I can't find the solution.

Relational model 101 : many to many relationship.
http://docs.djangoproject.com/en/dev/ref/models/fields/#manytomanyfield

HTH !-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to