Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Newbie question: many-to-many model creation [RSS Feed]

#1 Dec. 10, 2010 11:26:02

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

Newbie question: many-to-many model creation


Hi all,
im new to django

im using django 1.2
i have a model that has one many-to-many relationship field

How to create a object of this model ?

what to pass for the field that has many-to-many relationship?

--
Girish M S

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 10, 2010 11:46:37

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

Newbie question: many-to-many model creation


On Fri, 2010-12-10 at 16:55 +0530, girish shabadimath wrote:
> im new to django
>
> im using django 1.2
> i have a model that has one many-to-many relationship field
>
> How to create a object of this model ?
>
> what to pass for the field that has many-to-many relationship?

please give some details of your models
--
regards
Kenneth Gonsalves

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Dec. 10, 2010 11:54:33

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

Newbie question: many-to-many model creation


Thanks for the reply,,
Here are my models

class Checkers(models.Model):
name = models.CharField(max_length = 100)
weight = models.FloatField(default = 0)
desc = models.CharField(max_length = 1000)

class PrepCheckers(models.Model):
name = models.CharField(max_length = 150)
ABCcheckers = models.ManyToManyField(Checkers,
related_name = 'prevent45checkers')

now how to create PrepCheckers obj ?



On Fri, Dec 10, 2010 at 5:15 PM, Kenneth Gonsalves <law...@au-kbc.org>wrote:

> On Fri, 2010-12-10 at 16:55 +0530, girish shabadimath wrote:
> > im new to django
> >
> > im using django 1.2
> > i have a model that has one many-to-many relationship field
> >
> > How to create a object of this model ?
> >
> > what to pass for the field that has many-to-many relationship?
>
> please give some details of your models
> --
> regards
> Kenneth Gonsalves
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>


--
Girish M S

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Dec. 10, 2010 12:10:38

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

Newbie question: many-to-many model creation


http://www.djangoproject.com/documentation/models/many_to_many/Rgds,
Marcos

On Fri, Dec 10, 2010 at 8:54 AM, girish shabadimath <
girishmss.1...@gmail.com> wrote:

> Thanks for the reply,,
> Here are my models
>
> class Checkers(models.Model):
> name = models.CharField(max_length = 100)
> weight = models.FloatField(default = 0)
> desc = models.CharField(max_length = 1000)
>
> class PrepCheckers(models.Model):
> name = models.CharField(max_length = 150)
> ABCcheckers = models.ManyToManyField(Checkers,
> related_name = 'prevent45checkers')
>
> now how to create PrepCheckers obj ?
>
>
>
> On Fri, Dec 10, 2010 at 5:15 PM, Kenneth Gonsalves <law...@au-kbc.org>wrote:
>
>> On Fri, 2010-12-10 at 16:55 +0530, girish shabadimath wrote:
>> > im new to django
>> >
>> > im using django 1.2
>> > i have a model that has one many-to-many relationship field
>> >
>> > How to create a object of this model ?
>> >
>> > what to pass for the field that has many-to-many relationship?
>>
>> please give some details of your models
>> --
>> regards
>> Kenneth Gonsalves
>>
>> --
>> 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<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>>http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Girish M S
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>



--
Some people, when confronted with a problem, think “I know, I'll use regular
expressions.” Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Newbie question: many-to-many model creation [RSS Feed]

Board footer

Moderator control

Enjoy the 24th of August
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