I'm writting 2 models with ManyToMany Relations, first I make a model to
list all my requirements
class Requirements(models.Model):
requirement = models.CharField(max_length=150)
def __str__(self):
return self.requirement
So in this example my list of requirements will be:
- Person
Hey,
I am trying to solve following problem and I got stuck. Any help is
appreciated...
I have two models which represent a product and its parts.
class Product(models.Model):
name = models.CharField(max_length=200)
average_daily = models.FloatField(default=0)
average_monthly = models.Inte
> Dear experts,
>
> today I was inspecting the ManyToMany relations in the _meta subclass
> of a Model class of my database. At some time I realized that all data
> associated to such relations was lost in the database! The
> corresponding tables are empty. Other fields and relat
Dear experts,
today I was inspecting the ManyToMany relations in the _meta subclass
of a Model class of my database. At some time I realized that all data
associated to such relations was lost in the database! The
corresponding tables are empty. Other fields and relations are ok.
I suspect I
With update I also meant adding a new author to the publications in
the queryset. This (http://docs.djangoproject.com/en/dev/topics/db/
queries/#updating-multiple-objects-at-once) shows only how to update
usual fields, but no m2m Relations as I understand it. I want to add
objects. For publications
On Mon, Oct 18, 2010 at 8:49 PM, Marc Aymerich wrote:
>
>
> On Mon, Oct 18, 2010 at 6:31 PM, brix wrote:
>
>> Hello.
>>
>> Assume I have publications and authors. Like here:
>> http://www.djangoproject.com/documentation/models/many_to_many/
>>
>> Now I want to add authors to more than just one p
On Mon, Oct 18, 2010 at 6:31 PM, brix wrote:
> Hello.
>
> Assume I have publications and authors. Like here:
> http://www.djangoproject.com/documentation/models/many_to_many/
>
> Now I want to add authors to more than just one publication. Lets say
> 1000 or more publications.
>
> Is there a more
Hello.
Assume I have publications and authors. Like here:
http://www.djangoproject.com/documentation/models/many_to_many/
Now I want to add authors to more than just one publication. Lets say
1000 or more publications.
Is there a more efficient way of adding the authors once for each
publication
On May 19, 5:03 am, Daemoneye
wrote:
>
> class People(forms.Form):
> HoldComments=models.ManyToManyField('Comment')
> class Comment(forms.Form):
> CommentWord=models.CharField(max_length=1)
>
> I've had these two tables, I'd want the people make a comment so I new
> p=comment
class People(forms.Form):
HoldComments=models.ManyToManyField('Comment')
class Comment(forms.Form):
CommentWord=models.CharField(max_length=1)
I've had these two tables, I'd want the people make a comment so I new
p=comment(CommentWord=Comment)in the view
but how can I sav
I mean the users who have the number of group is the lagest ten.
and the relation is manytomany.thanks
On 1月29日, 下午8时05分, Stodge wrote:
> I think he needs to read the tutorial:
>
> http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-th...
>
> And I quote:
>
> "Here's one stab at th
I mean the users who have the number of group is the largest ten
and you see the relation is manytomany.
On 1月29日, 下午8时05分, Stodge wrote:
> I think he needs to read the tutorial:
>
> http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-th...
>
> And I quote:
>
> "Here's one stab at
I think he needs to read the tutorial:
http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-that-actually-do-something
And I quote:
"Here's one stab at the index() view, which displays the latest 5 poll
questions in the system"
On Jan 29, 4:57 am, Wayne Koorts wrote:
> What d
What do you mean by "top ten"?
On 29/01/2010, at 20:53, CCC wrote:
hi,
I have two models:user,group,and they are manytomany,
class User(model.Model):
name = models.CharField(max_length=20)
class Group(models.Model):
name = models.CharField(max_length=20)
users = models.ManytoMany
hi,
I have two models:user,group,and they are manytomany,
class User(model.Model):
name = models.CharField(max_length=20)
class Group(models.Model):
name = models.CharField(max_length=20)
users = models.ManytoManyField(User)
now i want to get the top ten users who have the groups
> model = CarModel.objects.filter(pk = modelId)
> for m in model.modelTypes.all():
> data = data+m.description+'|'
Your problem is that objects.filter(pk=modelId) gives you a list of
one element. You need to use either objects.get(pk=modelId) or
objects.filter(pk=modelId)[0].
--
You rec
dels(model)
}
class model
{
list of features
}
cheers
michael
- Original Message
From: Benjamin W.
To: Django users
Sent: Sun, December 27, 2009 4:37:51 PM
Subject: how to get ManyToMany relations?
Hi there,
I've problems to access manyToMany relartions.
I got the followin
Benjamin W. wrote:
> Hi there,
>
> I've problems to access manyToMany relartions.
> I got the following model:
>
> class ModelType(models.Model):
> description = models.CharField(max_length=100)
> def __unicode__(self):
> return u"%s" % (self.description)
>
> class CarM
Hi there,
I've problems to access manyToMany relartions.
I got the following model:
class ModelType(models.Model):
description = models.CharField(max_length=100)
def __unicode__(self):
return u"%s" % (self.description)
class CarModel(models.Model):
descrip
Por cierto, cuando ya este la base de datos llena de actuaciones nos invitas
a escuchar a los samberos.
Ariel.
On Tue, Oct 7, 2008 at 12:05 PM, Pablo Catalina <[EMAIL PROTECTED]>wrote:
> # python manage.py validate
> Error: One or more models did not validate:
> concerts.concert: Accessor for m
# python manage.py validate
Error: One or more models did not validate:
concerts.concert: Accessor for m2m field 'musicans' clashes with related m2m
field 'person.concert_set'. Add a related_name argument to the definition
for 'musicans'.
concerts.concert: Accessor for m2m field 'coches' clashes wi
On Mon, 2008-10-06 at 13:52 -0700, xkill wrote:
> Hello,
>
> I tried to add multiple manytomany fields to a class, that pointing to
> the same class.
>
> For example:
>
> class person(models.Model):
> name = models.CharField(max_length=30)
> phone = models.CharField(max_length=9, blank
On Mon, Oct 6, 2008 at 3:52 PM, xkill <[EMAIL PROTECTED]> wrote:
> But it doesn't work, how can I do it?
The error message you will receive will tell you what to do.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
--~--~-~--~~~---~-
Hello,
I tried to add multiple manytomany fields to a class, that pointing to
the same class.
For example:
class person(models.Model):
name = models.CharField(max_length=30)
phone = models.CharField(max_length=9, blank=True, null=True)
def __unicode__(self):
return self.name
On Sep 19, 10:24 am, "Nick Sandford" <[EMAIL PROTECTED]> wrote:
> Is there some kind of limit the admin imposes on the number of items
> it will show in a or the horizontal filter list? If so, can I
> change it? Also, is there any better way to do this?
raw_id_fields is the admin option you need
Hi all,
I currently have a site setup to manage students, teachers and
classrooms. In the classroom admin interface I have a horizontal
filter to select the students and teachers in a classroom. The only
problem is, I have roughly 1400 students and 400 teachers to select
from. From what I can see
On Sat, 2006-08-05 at 19:37 +0200, [EMAIL PROTECTED] wrote:
[...]
> I want to select now all objects of InfoType for Company belonging indirectly
> together by MetaObject.
>
> I have implemented this into Company:
>
> class Company(models.Model):
> ...
> def infotypes(self):
>
Hi all,
I have the following 3 Models:
class Company(models.Model):
name = models.CharField(maxlength=40)
class InfoType(models.Model):
type = models.CharField(maxlength=40)
class MetaObject(models.Model):
company = models.ManyToManyField(Company, null=True, blank=True)
In my model I have Papers and Persons. One Paper usually has multiple
Persons as authors, and they have to be in a determined order. Every
Person can of course be author for multiple Papers.
On top of all, I'd like to be able to edit authors inline and
re-arrange their order for every Paper in ad
29 matches
Mail list logo