What changes you did ?
Regards,
Akash Kandpal.
On Wed, Aug 29, 2018, 12:34 AM Vincent wrote:
> I figured it out :
>
> from django.db import models
> from django.contrib.auth.models import User
>
>
> # Create your models here.
> class Events(models.Model):
> Name = models.CharField(max_length=6
I figured it out :
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Events(models.Model):
Name = models.CharField(max_length=64)
Date = models.DateTimeField()
Description = models.CharField(max_length=200)
Admin = models.ForeignKey(Use
El ago. 23, 2015 3:34 PM, "venkat" escribió:
>
> How can i overcome this??
>
I think you should be using the related_name property in the ManyToMany
fields of the model. Giving different names, of course, since that maybe
the cause of your problems. It is documented, BTW.
HTH,
Carlos.
--
You r
> I have two models as follows
>
>
> class Person(models.Model):
> first_name = models.CharField(max_length=30)
> last_name = models.CharField(max_length=30)
> date_of_birth = models.DateField()
> height = models.IntegerField()
> def __unicode__(self):
> return '%s %s' %(self.first_name, self.last_
Hi ,
Did you try python psycopg2.
A simple deomostration.
Ex:-
import psycopg2
conn=psycopg2.connect("dbname='xxx' user='xxx' host='localhost'
password='xxx'")
cur = conn.cursor()
query="""SELECT * FROM bookmarkmanager_bookmark b '
'LEFT JOIN bookmarkmanager_bookmark_tags bt
did you use Bookmark.objetcs.all().select_related() ?
As this will create a join query... at least for your model you show in the
message I have found that for very complex joins, you need to use raw
query and not a Model.
On Thursday, April 25, 2013 10:44:28 AM UTC-4, Matthieu Bouron wrote
On Thursday, April 11, 2013 5:39:57 PM UTC+2, Tom Evans wrote:
>
> On Thu, Apr 11, 2013 at 3:42 PM, Matthieu Bouron
> > wrote:
> > Hello,
> >
> > Is there a way to handle many-to-many relationship with raw sql queries
> ?
> > I have the following model:
> >
> > from django.db import models
On Thu, Apr 11, 2013 at 3:42 PM, Matthieu Bouron
wrote:
> Hello,
>
> Is there a way to handle many-to-many relationship with raw sql queries ?
> I have the following model:
>
> from django.db import models
>
> class Tag(models.Model):
> name = models.CharField(max_length=512, unique=True)
>
>
ok, it looks very nice i will try and let you know.. thanks
2012/7/24 Tomas Neme
>
> > as shown in the picture, this i could do by add a method in the model
> > getTienda1 and return the stock and do it for each store, but i want it
> to
> > be created dinamically because the user could create a
> as shown in the picture, this i could do by add a method in the model
> getTienda1 and return the stock and do it for each store, but i want it to
> be created dinamically because the user could create a new store and it
will
> not be there.
>
> so this is my cuestion: can i do that?
Interesting
Hey Jorge,
> The relation disappears when (existing a relation) y use this modelForm
> without including any info for the friends field (I don't what to edit this
> information at this point). At this moment, django erases the relation
> within A an B because wasn't explicit declared and the form
Hello Rubens,I have similar problems months ago.
In my application there is a ManyToMany relation within two classes (A and
B) let's name the relation as "friends".
The application works fine but in unpredictable situations rows from the
auxiliary table that makes the relation disappears randomly.
Russ,
Thanks fo the reply!
> The only thought I have is that you appear to be using a pre-existing
> table to manage the m2m relationship, rather than the default produced
> Django table. This shouldn't pose a problem, but it does lead me to
> wonder if there is some other process that could be
Hi Malcolm,
>> class BidirectionalField(models.ManyToManyField):
>> def __init__(self, *args, **kwargs):
>> super(BidirectionalField, self).__init__(*args, **kwargs)
>> self.creates_table = False
> BY the way, this has been discussed in the past and is really the wrong
> way
On Fri, 2009-04-24 at 15:32 -0300, Rubens Altimari wrote:
> Hello,
>
>
> Sorry if this is a known issue, but I didn't find anything elsewhere.
>
>
> I have these two models related by a many-to-many relationship. I'm
> using the 'default' admin application to edit data, and in order to be
> ab
On Sat, Apr 25, 2009 at 2:32 AM, Rubens Altimari wrote:
> Hello,
> Sorry if this is a known issue, but I didn't find anything elsewhere.
> I have these two models related by a many-to-many relationship. I'm using
> the 'default' admin application to edit data, and in order to be able to
> edit bo
Dear Karen,
Thank you very much for your response. It was very helpful and solved
my problem!
As I said, I am just beginning with Django, so could not quite
understand where the problem lies. However, I will try to post a more
useful and descriptive phrasing of the problem, including traceback
On Tue, Sep 30, 2008 at 4:52 AM, chris <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> Just starting to use django, so forgive me if this has been answered
> before (a quick search at djanog-search did not turn up something
> useful).
> What I am trying to do is similar to this (from
> http://www.dja
Exception Value: has more
than 1 ForeignKey to
hmm. I'm not sure.
you might be able to get it to work by fudging something or other.
but when it gets complicated like this, and it gets complicated for
django's ORM, then I think its better to rearrange the approach.
On Oct 1, 2:18 pm, chri
Dear Felix,
Thanks for following up on this. I put the traceback up here:
http://paste.pocoo.org/show/86707/
I will try to follow your advice to work around the error and define
the tables differently, since you are right about the way this should
work in the admin interface. But I still thin
post the traceback. I may not be able to help you since I haven't
tried to do person-to-person at all.
it might be simpler to just do Friends and Idols (without using
through and without friends and idols being fields on Person)
and then add methods to Person that fetch those relationships.
or
On Sep 30, 8:07 pm, felix <[EMAIL PROTECTED]> wrote:
> are you actually getting a runtime error or an error when trying to
> syncdb ?
syncdb works fine, but then I get a runtime error when I want to edit
such a record in the admin interface. The traceback complains about
the two foreign keys
are you actually getting a runtime error or an error when trying to
syncdb ?
On Sep 30, 10:52 am, chris <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> Just starting to use django, so forgive me if this has been answered
> before (a quick search at djanog-search did not turn up something
> useful).
>
23 matches
Mail list logo