On Wed, Dec 1, 2010 at 12:48 PM, Ferran wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Hello everyone,
>
> I want to have foreign keys to parent model on a manytomany
> intermediate table (through) to have unique entries for that domain.
>
> The problem is i want this parent mod
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
On 01/12/10 12:48, Ferran wrote:
> I've thought maybe i can implement contacts and ns fields in both
> DomainOwned and DomainPending, using generic relationships, but it
> does not seems right to me.
Shame on me.
This is the right way to do it, the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hello everyone,
I want to have foreign keys to parent model on a manytomany
intermediate table (through) to have unique entries for that domain.
The problem is i want this parent model class to be an abstract one,
because i don't ever want to inst
First thought is "You haven't provided anywhere near enough context".
Second thought is "That is how it works, so you're doing something
else wrong. See #1".
class PropertyValue(BaseModel):
value = models.CharField(max_length=256)
prop = models.ForeignKey('Property')
parent = models.Foreign
Any thoughts on this?
On Sep 22, 10:47 am, Yo-Yo Ma wrote:
> Anyone know how to do this?
>
> On Sep 21, 10:35 pm, Yo-Yo Ma wrote:
>
>
>
> > I have a model with:
>
> > parent = ForeignKey('self', blank=True, null=True)
>
> > In that model I've overridden clean() to contain:
>
> > if self.parent:
Anyone know how to do this?
On Sep 21, 10:35 pm, Yo-Yo Ma wrote:
> I have a model with:
>
> parent = ForeignKey('self', blank=True, null=True)
>
> In that model I've overridden clean() to contain:
>
> if self.parent:
> # Do some stuff
>
> It raises an attribute error saying that parent.pk doe
I have a model with:
parent = ForeignKey('self', blank=True, null=True)
In that model I've overridden clean() to contain:
if self.parent:
# Do some stuff
It raises an attribute error saying that parent.pk doesn't exist. How
can I get around this. Note that my foreign key is recursive.
--
OK thanks. I didn't realise that was the implication of the
related_name field. All working as expected now.
Thanks, Ben
On 28 Feb, 13:16, Daniel Roseman wrote:
> On Feb 28, 11:46 am, Ben Dowling wrote:
>
>
>
> > I have a Thread and a Message model, as defined below:
>
> > class Thread(models.M
On Feb 28, 11:46 am, Ben Dowling wrote:
> I have a Thread and a Message model, as defined below:
>
> class Thread(models.Model):
> modified = models.DateTimeField(auto_now=True, auto_now_add=True)
>
> class Message(models.Model):
> subject = models.CharField(max_length = 100)
>
I have a Thread and a Message model, as defined below:
class Thread(models.Model):
modified = models.DateTimeField(auto_now=True, auto_now_add=True)
class Message(models.Model):
subject = models.CharField(max_length = 100)
thread = models.ForeignKey(Thread, related_name='t
10 matches
Mail list logo