I have two models connected by manytomany relationship and I am trying to
use `formset` to create a dynamic form. I am able to save the form but the
problem arise when I am trying to edit the saved instance, I don't know how
to properly pass the instance to the formset such that it show
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
Hello,
I'm new to Django and i'm trying to made a simple app in which users can
attend to an event. I'm trying to have this manageable through the admin
site but i get the following error :
: (admin.E202) fk_name 'attendees' is
not a ForeignKey to 'evenement.Events'.
My goal is to have an inte
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_
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_name)
class Movie
Hi,
Have you had any solutions to this yet?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, sen
ysets/#django.db.models.**query.QuerySet.get_or_create<https://docs.djangoproject.com/en/1.5/ref/models/querysets/#django.db.models.query.QuerySet.get_or_create>
>
> hth
>
> Mike
>
>
>>
>>
>>
>>
>> On Tuesday, October 22, 2013 11:59:14 PM UTC+2, Ti
someone point me to where this is explained in the docs (1.6)?
>>
>> I have a ManyToMany relationship in my models between Author and Paper.
>>
>> I am processing an XML file to create records for Papers.
>>
>> I want to check if an Author exists and if not cre
ect.com/en/1.5/ref/models/querysets/#django.db.models.query.QuerySet.get_or_create
hth
Mike
On Tuesday, October 22, 2013 11:59:14 PM UTC+2, Timothy W. Cook wrote:
Can someone point me to where this is explained in the docs (1.6)?
I have a ManyToMany relationship in my models between Author and Paper.
I am processin
11:59:14 PM UTC+2, Timothy W. Cook wrote:
>
> Can someone point me to where this is explained in the docs (1.6)?
>
> I have a ManyToMany relationship in my models between Author and Paper.
>
> I am processing an XML file to create records for Papers.
>
> I want to check i
Can someone point me to where this is explained in the docs (1.6)?
I have a ManyToMany relationship in my models between Author and Paper.
I am processing an XML file to create records for Papers.
I want to check if an Author exists and if not create the record.
This was quite easy for Foreign
I need to mimic a *spreadsheet* with Django for a simple school app like
'*task/student
> score*', so I have this models:
- Actividad (tasks)
- Alumno (students) > M2M to 'Actividad' through 'Calificacion'
- Calificacion (scores)
I don't know how to proceed, if I need a formset or wh
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)
>
>
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)
class Bookmark(models.Model):
link = models.CharField(max_length=512)
I can not for the life of me figure out why my list_display works when the
django server is in DEBUG=True but not when it is in DEBUG=False. I am
using Django 1.4.3 (mod_wsgi 3.4/Python 2.7)
Here is the partial stack trace...
File
"/home/difuzi0n/webapps/wedding/lib/python2.7/django/db/m
I found where the problem is...
It is not a problem in the ManyToManyField but in the intermediate table.
Django refused that my intermediate table doesn't have an unique id !
So, in the sql which created django, it created automatically an unique id
named "id", but in my database I didn't cr
Ok, it is still not working.
Django can't find the intermediate table.
And I can't put an "inlines" into an "inlines" ! My RunHasSample are
already in a field "inlines" in the RunAdmin, so I cannot put the lines in
an "inlines" field into the class RunHasSamplesInLine
--
You received this me
>
> In [10]: run1= Run(project=Project.objects.get(pk=1),
> sequencing_type=SequencingType.objects.get(pk=1))
> In [11]: run1.save()
> In [12]: Run.objects.all()
Out[12]: []
> In [13]: s1=RunHasSample(run=run1, sample=Sample.objects.get(pk=1),
> dna_quantification_ng_per_ul=1)
> In [14]
It's true: the Run model does not have a "lines" attribute; the
RunHasSample model does. Also, `s1` is not a Line nor a Sample, it's an
instance of the intermediary RunHasSample. So you're not going to be able
to directly add a Line instance to a Run instance- you'll have to add it to
the rel
>
> In [10]: run1= Run(project=Project.objects.get(pk=1),
>> sequencing_type=SequencingType.objects.get(pk=1))
>
>
>> In [11]: run1.save()
>
>
>> In [12]: Run.objects.all()
>
> Out[12]: []
>
>
>> In [13]: s1=RunHasSample(run=run1, sample=Sample.objects.get(pk=1),
>> dna_quantification_ng_per_ul=
didn't get any answer. I think
> this is something really simple. I just need to fullfill my database via a
> ManyToMany field... Why doesn't it work ? I don't know, but I am
> desperate...
>
> I give you the link :
> http://stackoverflow.com/questions/12918651/addi
Hi,
thanks for the links, I have look at these docs but I can't figure out how
to mix actions with a spreadsheet like presentation :-/
Is it possible to create admin forms like we can standards forms?
Another way I could try is to use filter_horizontal (I like this
presentation), but for a m2m re
On 31-7-2012 11:33, goabbear wrote:
> There's 3 tables, user(name, mail), mailinglist(name) and an intermediate
> table subscription where are stored all the users joining some
> mailinglists.
> How can I present the "subscription" table to the admins like a
> spreadsheet, where the first colu
Hi all,
I start with django but after some searches I can't do what I want in the
admin section of my app.
There's 3 tables, user(name, mail), mailinglist(name) and an intermediate
table subscription where are stored all the users joining some
mailinglists.
How can I present the "subscription"
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 guys
i have an issue, i don know if it really can be done.
im using django 1.3
i have a model producto(product) and Tienda(store)
and a product could be in one or more stores, so i created a many to many
relationship but y have a stock in each store, so i use the intermediary
model Produc
I have the following models
class Group(models.Model):
name = models.CharField(max_length=32, unique=True)
class Subgroup(models.Model):
name = models.CharField(max_length=32, unique=True)
group = models.ForeignKey(Group)
class KeywordsList(models.Model):
name = models.CharField(
Le 05/03/2011 00:01, kgardenia42 a écrit :
Thanks. This is pretty close to what I'm doing. However, I'd like to
not have to write all the associated boiler-plate (i.e. I have to
figure out if any film/actor relationships have been deleted since the
last save and explicitly write code to remo
On Fri, Mar 4, 2011 at 1:08 PM, werefr0g wrote:
> On Thu, Mar 3, 2011 at 11:50 AM, werefr0g wrote:
>
> Hello,
>
> Sorry if I misunderstand, but what is wrong about using a ModelForm on your
> Film bounded to the film instance?
>
> My bad... how did I missed the intermediary model involved in the
sorry, I failed to pass the request to the view's function,..
Le 04/03/2011 22:08, werefr0g a écrit :
On Thu, Mar 3, 2011 at 11:50 AM, werefr0g wrote:
Hello,
Sorry if I misunderstand, but what is wrong about using a ModelForm on your
Film bounded to the film instance?
My bad... how did I miss
On Thu, Mar 3, 2011 at 11:50 AM, werefr0g wrote:
Hello,
Sorry if I misunderstand, but what is wrong about using a ModelForm on your
Film bounded to the film instance?
My bad... how did I missed the intermediary model involved in the
ManyToMany relashionship. Sorry.
When I tried that I kept
On Thu, Mar 3, 2011 at 11:50 AM, werefr0g wrote:
> Hello,
>
> Sorry if I misunderstand, but what is wrong about using a ModelForm on your
> Film bounded to the film instance?
When I tried that I kept running into this error:
"Cannot set values on a ManyToManyField which specifies an
intermediar
Hello,
Sorry if I misunderstand, but what is wrong about using a ModelForm on
your Film bounded to the film instance?
Regards
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com.
Hi list,
Considering this schema (below) I'm trying to figure out how to create
a ModelForm which links Actors to Films (all known actors in a multi-
select widget). I can't seem to figure out how to do this in a way
that ModelForm will do the heavy lifting.
I would like to make a page (e.g. /fi
I will answer to myself (after having been trying for over an hour, I
found the answer a couple of minutes after posting my question)
products =
Product.objects.filter(productlicence__client=client).distinct()
--
You received this message because you are subscribed to the Google Groups
"Django
Sorry for the question,
but I've been trying for over an hour and just when I post this
message, I find the answer!!
Here is it:
products =
Product.objects.filter(productlicence__client=client).distinct()
Hope that it will be useful
--
You received this message because you are subscribed to the
Hello everybody
this is maybe simple but I can't succeed in making a query.
here is my model:
class Client(models.Model):
user= models.OneToOneField(User)
product_licence= models.ManyToManyField('ProductLicence',
blank=True, null=True)
class ProductLicence(models.
Thanks, Carlos!
Brian
On Aug 5, 12:59 pm, Carlos Daniel Ruvalcaba Valenzuela
wrote:
> There is an option to default to InnoDB tables on the configuration:
>
> http://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables
>
> Regards,
> Carlos Daniel Ruvalcaba Valenzuela
>
> On Thu, Au
There is an option to default to InnoDB tables on the configuration:
http://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables
Regards,
Carlos Daniel Ruvalcaba Valenzuela
On Thu, Aug 5, 2010 at 12:48 PM, bksfu wrote:
> When Django created the above tables, they were created with
When Django created the above tables, they were created with the
MyISAM engine. If the intermediate table has to have foreign keys
back to the Phone and Room tables, this would be illegal from MySQL's
perspective, which can apparently only form foreign key constraints
between InnoDB tables. If th
Hi, I have the following model:
--
from django.db import models
class Phone(models.Model):
id = models.AutoField(primary_key=True, db_column='id')
type = models.CharField(max_length=1, db_column='Type',
null=False, blank=False)
status = models.CharField(max_length=1, db_column
Say I have 2 classes as:
class Bar(models.Model):
prop = IntegerField()
class Foo(models.Model):
bar = ManyToManyField(Bar)
I want to return a QuerySet containing model instances of bar that
match the query:
QuerySetOfFoos.objects.filter(bar__prop__gt=0)
Is there an easy way to do this?
I would also like to select multiple
Foo objects from Bar in the admin page. Is that possible? How can I do that?
Thank you!
--
View this message in context:
http://old.nabble.com/Admin.py%3A-Creating-double-ended-ManyToMany-relationship-tp29024100p29024100.html
Sent from the django-users mailing
Hi everyone, considering these two classes.
class Foo(models.Model):
bar = models.ManyToManyField(Bar, blank=True, null=True,
default=None)
class Bar(models.Model):
pass
I have a many to many relationship in my admin page so I can select
multiple Bar objects on Foo, which is good, but I
On Tue, Apr 27, 2010 at 9:50 AM, Florian Le Goff wrote:
> Hi,
>
> I'm using Django's 1.1.1 official release and I'm trying to build a
> partial form, using ModelForm, with only one field, of the
> ManyToManyField type.
>
> If my partial form's Meta class "fields" attribute contains several
> attri
Hi,
I'm using Django's 1.1.1 official release and I'm trying to build a
partial form, using ModelForm, with only one field, of the
ManyToManyField type.
If my partial form's Meta class "fields" attribute contains several
attributes names, everything is working pretty smoothly. My form is
produced
On Wed, Mar 24, 2010 at 6:16 PM, mbdtsmh
wrote:
> Hi All, still trying to get my head around the multi db stuff in 1.2
> release.
>
> Here is my problem that I have hit upon.
>
> I have a model in my default db...
>
> class Set1(models.Model):
> create_date = models.DateTimeField(auto_now_add='
Hi All, still trying to get my head around the multi db stuff in 1.2
release.
Here is my problem that I have hit upon.
I have a model in my default db...
class Set1(models.Model):
create_date = models.DateTimeField(auto_now_add='True')
last_update = models.DateTimeField(auto_now='True',
Hi,
I am relatively new with Django but I like what I have seen so far.
why does this not work?
class Tag(models.Model):
text = models.CharField(max_length=200)
children = models.ManyToManyField('self', blank=True, null=True,
symmetrical=True, related_name='parents')
synonyms = model
On Thu, Nov 26, 2009 at 6:31 PM, David wrote:
>
> >>> Listing.objects.order_by("book__courses")
>
> gives me Listings with id's (5, 1, 3, 5, 2, 4), and
>
> >>> Listing.objects.order_by("-book__courses")
>
> gives me Listings with id's (6, 4, 5, 2, 5,1)
On Thu, Nov 26, 2009 at 6:38 PM, David wrot
as if the duplicate id "swallowing up" the missing records. I
have no clue why though... hope these details help clarify my problem.
On Nov 26, 1:31 pm, David wrote:
> When I order over a ManyToMany relationship, certain records will not
> appear. The record which disappears chan
When I order over a ManyToMany relationship, certain records will not
appear. The record which disappears changes depending on the order by
which I sort it. Specifically:
>>> Listing.objects.order_by("book__courses")
gives me Listings with id's
e'
I'm at a loss as to how I'm supposed to update these relationships
Ray
On Aug 18, 7:03 pm, Daniel Roseman wrote:
> On Aug 18, 9:49 pm, Ray wrote:
>
> > I know in the backend, a manytomany relationship is essentially a join
> > table, but there seems to be no ea
On Aug 19, 10:09 pm, Ray wrote:
> Hi,
> thanks for the fast response! I'm trying to use the remove function
> right now just like this sample code:
>
> # And from the other end>>> p2.article_set.remove(a5)
> >>> p2.article_set.all()
> []
> >>> a5.publications.all()
>
> []
>
> fromhttp://www.djang
On Aug 18, 9:49 pm, Ray wrote:
> I know in the backend, a manytomany relationship is essentially a join
> table, but there seems to be no easy way to delete relationships from
> it. The only remove option is made only for ForeignKey relationships.
> Is there a workaround? Why would d
On Aug 18, 9:49 pm, Ray wrote:
> I know in the backend, a manytomany relationship is essentially a join
> table, but there seems to be no easy way to delete relationships from
> it. The only remove option is made only for ForeignKey relationships.
> Is there a workaround? Why would d
Hi,
Is there a way to create an inlineformset for two models with
manytomany relationship. I have created:
class Person(models.Model):
name = models.CharField
phone= models.ManyToMany(Phone)
class Phone(models.Model):
PHONE_CHOICES(('H','Home'),(
I know in the backend, a manytomany relationship is essentially a join
table, but there seems to be no easy way to delete relationships from
it. The only remove option is made only for ForeignKey relationships.
Is there a workaround? Why would django design a relationship that you
can only add
Nevermind, found this:
http://www.djangoproject.com/documentation/models/many_to_many/
And got it working. woo WOOO!!!
On Tue, Jul 14, 2009 at 2:28 PM, Jesse Warden wrote:
> n00b here. I'd like to create a complex Model from a Flex Object
> (basically decoded JSON). I've created a Model succe
n00b here. I'd like to create a complex Model from a Flex Object (basically
decoded JSON). I've created a Model successfully already, but am unsure how
to do this with the multiple Models that have ManyToMany relationships with
each other.
This works:
def create_power(request, powerObj):
try:
p
No, you have to save self before you can add categories to it, because
you can't save an M2M if either object is missing a primary key.
In any case, it turns out that the reason is that the admin saves the
submitted M2M data after the save() method is called on the main
model. So it erases and
Hi,
> defsave(self, *args):
> models.Model(save, *args)
> category = Category.objects.all()[0]
> self.categories.add(category)
>
> This does not work, I'm sure it's saving ManyToMany relationships
> later on in thesaveprocess. Is there a way to make this work?
>
IMHO, it's make sense :
(self, *args):
> models.Model.save(self, *args)
> category = Category.objects.all()[0]
> self.categories.add(category)
>
> However, that point is not the problem. Even with the proper syntax,
> it doesn't save the ManyToMany relationship.
proper syntax,
it doesn't save the ManyToMany relationship.
--
Adam Olsen
SendOutCards.com
http://www.vimtips.org
http://last.fm/user/synic
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On Mon, Apr 27, 2009 at 1:24 PM, Adam Olsen wrote:
>
> I've got two models, something like this:
>
> class Category(models.Model):
>name = models.CharField(max_length=60)
>
> class Product(models.Model):
>sku = models.CharField(max_length=20)
>categories = models.ManyToManyField(Categ
I've got two models, something like this:
class Category(models.Model):
name = models.CharField(max_length=60)
class Product(models.Model):
sku = models.CharField(max_length=20)
categories = models.ManyToManyField(Category)
I want to overload the save method to automatically add cer
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
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 both sides of the relationship, I'm using the snippet provided by
pow
Hey there,
I've been searching this group for a working example of a complex
form using a ManyToMany relationship with an intermediary model.
I've read this documentation to know a bit more about the ManyToMany
relationship:
http://docs.djangoproject.com/en/dev/topics/db/models/#in
>
> 1. How do I create a Model Manager?
See http://docs.djangoproject.com/en/dev/topics/db/managers/
2. Within a view, what is the best way to add entries into tables that
> have a M2M relationship with an intermediate table? I've been reading
> the following documentation with command line opt
Hi,
I have the same problem. Does anyone have any suggestions for how to
save forms when the "through" attribute is used on a ManyToMany
attribute?
Regards,
Luke
SnappyDjangoUser wrote:
> Hi Everyone,
>
> I need some guidance with adding table entries where I have a M2M
> table relationship. I
I have the same problem. Does anyone have an example of what we the
code in the view would look like?
On Sep 25, 2:37 pm, SnappyDjangoUser <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> Am I on the right track with my M2M model definition (which includes
> an intermediate table)? I still need hel
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).
>
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.djangoproject.com/documentation/models/m2m_recursive/):
from django.db import model
Hi Everyone,
Am I on the right track with my M2M model definition (which includes
an intermediate table)? I still need help with 2 questions:
1. How do I create a Model Manager?
2. Within a view, what is the best way to add entries into tables that
have a M2M relationship with an intermediate
Hi Everyone,
I need some guidance with adding table entries where I have a M2M
table relationship. I am adding entires via a Quote ModelForm. The
problem is that I am getting the following error when submitting the
form: "Cannot set values on a ManyToManyField which specifies an
intermediary m
variable name collision.
caused by locals()
On May 18, 8:05 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Very odd. On a whim, I changed:
>
>
> {% for instructor in instructors %}
> {{ instructor.first_name }} #there is no value output
> here
> {% endif %}
>
>
> to
>
>
> {% for i in inst
Very odd. On a whim, I changed:
{% for instructor in instructors %}
{{ instructor.first_name }} #there is no value output
here
{% endif %}
to
{% for i in instructors %}
{{ i.first_name }} #this works?!
here
{% endif %}
Can anyone offer some reason why that would work? Just for my
Here is my code:
#in models.py
class Instructor(models.Model):
prefix = models.CharField(max_length=50, blank=True, null=True)
first_name = models.CharField(max_length=50)
middle_name = models.CharField(max_length=50, blank=True,
null=True)
last_name = models.CharField(max_length=
Hi everyone,
I have a ManyToMany field on a model, and when I want to get the
related items and display them in a template in a for loop, the loop
executes the correct number of times, but in my output blocks there
are no values.
If I print the object, I get an array of values, same as any other
Hi list,
I'm building an app where a model has a manyTomany relationship with
User model.
There are two things I can't figure out :
1. How can I add to User admin form the list of items related to it ?
2. How can I add a specific field to the relation table ?
Thanks,
On 12/8/06, naitsirhc <[EMAIL PROTECTED]> wrote:
> I'm kind of surprised that I didn't find
> mention of the 'raw_id_admin' in my previous searches - is it
> relatively new?
Nope, it's not new -- raw_id_admin has been around since before Django
was open-sourced.
Adrian
--
Adrian Holovaty
holov
Thank you very much for your help. I should be able to modify this to
suit my needs perfectly. I'm kind of surprised that I didn't find
mention of the 'raw_id_admin' in my previous searches - is it
relatively new? I see that it has been involved in some active
development in the Django source c
1 - 100 of 117 matches
Mail list logo