On 10/27/06, Tom Smith <[EMAIL PROTECTED]> wrote:
> Is there a way to do a complete dump, re-build the database and then
> import stuff (avoiding import errors... i.e doing some form of
> coercion)?
Use mysqldump with the --no-create-info option which avoids dumping
the table schemas. Drop the d
> Just to establish that we are all on the same page: are you seeing the
> error when you use exactly the model example you posted yesterday and
> cut and paste the queryset constructor that Rajesh posted? That should
> be working.
No, it fails for me, we are on the same page.
> If that is fail
On Wed, 2006-10-11 at 19:53 +0100, Tom Smith wrote:
>
> On 11 Oct 2006, at 18:59, Rajesh Dhawan wrote:
[...]
> >
> > Perhaps try upgrading to a recent SVN of Django? I am on 0.96-pre.
> >
>
>
> I upgraded...
>
>
>
> > Also, I am using SQLite for the DB but that should not matter, I
> > thi
On 11 Oct 2006, at 18:59, Rajesh Dhawan wrote:Hi, This still works for me! The only change I made to your model was to add a "class Admin: pass" to your ProductWord class so that I could add a ProductWord test object through the Admin UI. My results in the shell: from my_app.models import Produ
On 10/11/06, RajeshD <[EMAIL PROTECTED]> wrote:
>
>
>
> On Oct 11, 9:59 am, Tom Smith <[EMAIL PROTECTED]> wrote:
> > Oops... replied to wrong thread...
> >
> > here it is...
> >
> > It has a lot of stuff... but the core is simple enough, like this...
> >
>
> I just whipped up something based on yo
On Oct 11, 9:59 am, Tom Smith <[EMAIL PROTECTED]> wrote:
> Oops... replied to wrong thread...
>
> here it is...
>
> It has a lot of stuff... but the core is simple enough, like this...
>
I just whipped up something based on your model definition excerpts and
it works perfectly with:
Product.ob
Oops... replied to wrong thread...
here it is...
It has a lot of stuff... but the core is simple enough, like this...
class Product(models.Model):
title = models.CharField(maxlength=200, db_index=True)
url = models.URLField(maxlength=250, db_index=True, unique=True)
>
> > Product.objects.filter
> > (productword__fk_word__value__exact='thomas').distinct()When I try that...
> > I get...
>
> TypeError: Cannot resolve keyword 'productword' into field
That should work. Can you attach your model?
--~--~-~--~~~---~--~~
You receive
On 10 Oct 2006, at 22:11, RajeshD wrote:
>
> See if this helps:
>
> Product.objects.filter
> (productword__fk_word__value__exact='thomas').distinct()
When I try that... I get...
TypeError: Cannot resolve keyword 'productword' into field
--~--~-~--~~~---~--~~
Y
Hi, I myself am learning this, but I'd like to take a crack at your
question.
Based on the DB API document, you need to employ both select_related()
(to go from a model with a FK to the objects related by that FK), and
somefield_set (to go the other way). (Note it seems select_related is
a method
See if this helps:
Product.objects.filter(productword__fk_word__value__exact='thomas').distinct()
--~--~-~--~~~---~--~~
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
Or to put it more simply... all I'm trying to do is this...
Select * from myapp_product, myapp_productword, myapp_word
where
myapp_productword.fk_product_id = myapp_product.id
and
myapp_productword.fk_word_id = myapp_word.id
and
value = 'assam'
order by title
..returning Product objects...
--
My model is like this...
class Product(models.Model):
class Word(models.Model):
value = models.CharField(maxlength=200, core=True, unique=True)
class ProductWord(models.Model):
fk_word = models.ForeignKey(Word , core=True)
fk_product = models.ForeignKey(Produc
13 matches
Mail list logo