On 3/5/06, kmh <[EMAIL PROTECTED]> wrote:
>
> Russell Keith-Magee wrote:
> > We could get really carried away here, but I'm not sure if there is
> > any gain. The problem you are describing has existed since pre-MR days
> > (and can be seen living large in the unit tests), and while it is an
> > i
Russell Keith-Magee wrote:
> On 3/3/06, kmh <[EMAIL PROTECTED] > wrote:
> >
> > My concern is that you end up with this:
> >
> > book.authors = [author1, author2]
> > book.authors == [author1, author2] # not true
>
> Well, if we want to get picky like that, then book.authors should
> evaluate as
On 3/3/06, kmh <[EMAIL PROTECTED] > wrote:
>
> My concern is that you end up with this:
>
> book.authors = [author1, author2]
> book.authors == [author1, author2] # not true
Well, if we want to get picky like that, then book.authors should
evaluate as a set as well, unless an order_by has been
Russell Keith-Magee wrote:
> On 3/3/06, kmh <[EMAIL PROTECTED]> wrote:
> >
> >
> > If it were a 'set' method assignment would not be possible and an
> > exception hinting to use 'set' would be raised.
>
>
> (Damn English language... setting the set with a set...)
>
> If I am understanding you corr
On 3/3/06, kmh <[EMAIL PROTECTED]> wrote:
If it were a 'set' method assignment would not be possible and anexception hinting to use 'set' would be raised. (Damn English language... setting the set with a set...)If I am understanding you correctly, you are opposed to having assignment notation for
Russell Keith-Magee wrote:
> On 3/3/06, kmh <[EMAIL PROTECTED]> wrote:
>
> > Assigning a list implies assigning an order. How about:
>
>
> book.authors.set([author1, author2])
>
>
> This doesn't address the problem - what is the 'set' behaviour of the
> descriptor protocol.
>The start of the expre
On 3/3/06, kmh <[EMAIL PROTECTED]> wrote:
Assigning a list implies assigning an order. How about:book.authors.set([author1, author2])
This doesn't address the problem - what is the 'set' behaviour of the descriptor protocol. The start of the _expression_ has to be 'book.authors ='; the question is
Russell Keith-Magee wrote:
> I can see the merit in finishing the descriptor protocol
> for all m2m objects. So:
>
> book.authors = [author1, author2]
> would be equivalent to
> book.author.clear(); book.author.add(author1, author2)
Assigning a list implies assigning an order. How about:
book.au
On 3/3/06, Luke Plant <[EMAIL PROTECTED]> wrote:
fields. For ManyToMany, you do: book.author.add(author1, author2...)I guess it would be good if the __set__ descriptor was there, and eitherdid the right thing or threw some exception.
I've been working with the descriptor protocol on RelatedManage
On Thursday 02 March 2006 04:49, xamdam wrote:
> class Book(models.Model):
> name = models.CharField(maxlength=200)
> author = models.ManyToManyField(Person)
> def set_author(self, a): self.author = a # is this (having to
> define the set_ method) fixed yet?
> def __repr__(self):
I am playing with a class like this:
class Book(models.Model):
name = models.CharField(maxlength=200)
author = models.ManyToManyField(Person)
def set_author(self, a): self.author = a # is this (having to
define the set_ method) fixed yet?
def __repr__(self):
return self.na
11 matches
Mail list logo