Re: Many-to-many column admin interface

2009-08-30 Thread Thomas Guettler
Thank you for this link. Looks good Sven Richter schrieb: > Ah, and google does help or at least django_snippets. > I found the solution here: > http://www.djangosnippets.org/snippets/1295 > > The trick is to create a column in both models and in one with the option to > not syncdb. > Its really

Re: Many-to-many column admin interface

2009-08-28 Thread Sven Richter
Yea, i thought about that, but for me this seems like an ugly workaround. Dont misunderstand me, i dont know enough about django and its database internals, but why should i use a third model for something i can access directly? The solution i posted above was exactly what i was looking for and wh

Re: Many-to-many column admin interface

2009-08-28 Thread Sven Richter
But i wonder how this would help me further. In the End it doesnt matter for me on which model i define the M2M relation. But i need to access the M2M Table from both models, at least in the view or in the template if not in the admin interface. I am having a hard time finding out how to achieve t

Re: Many-to-many column admin interface

2009-08-28 Thread Sven Richter
Ah, and google does help or at least django_snippets. I found the solution here: http://www.djangosnippets.org/snippets/1295 The trick is to create a column in both models and in one with the option to not syncdb. Its really simple, just 6 lines at all. Greetings and a nice Weekend Sven On Fri,

Re: Many-to-many column admin interface

2009-08-28 Thread patrickk
I could be mistaken ... but why not using a third model. C(models.model): a = models.ForeignKey('A') b = models.ForeignKey('B') when editing either A or B, you could use C as inlines. regards, patrick On 28 Aug., 17:18, Sven Richter wrote: > But i wonder how this would help me further.

Re: Many-to-many column admin interface

2009-08-28 Thread Sven Richter
I've opened a bug/feature request at: http://code.djangoproject.com/ticket/11795#comment:2 if someone is interested. Greetings Sven On Fri, Aug 28, 2009 at 6:59 AM, Craig McClanahan wrote: > > On Thu, Aug 27, 2009 at 10:00 AM, Sven Richter > wrote: > > I found this thread: > > > http://stackove

Re: Many-to-many column admin interface

2009-08-28 Thread Craig McClanahan
On Thu, Aug 27, 2009 at 10:00 AM, Sven Richter wrote: > I found this thread: > http://stackoverflow.com/questions/660260/django-admin-form-for-many-to-many-relationship > on Stackoverflow, but when i try the suggested TabularInline thing i get the > error: > > has no ForeignKey to 'politlog.entr

Re: Many-to-many column admin interface

2009-08-27 Thread Sven Richter
I found this thread: http://stackoverflow.com/questions/660260/django-admin-form-for-many-to-many-relationship on Stackoverflow, but when i try the suggested TabularInline thing i get the error: has no ForeignKey to Greetings Sven On Thu, Aug 27, 2009 at 5:03 PM, Thomas Guettler wrote: > >

Re: Many-to-many column admin interface

2009-08-27 Thread Thomas Guettler
Hi, I had the same question some time ago and found no answer, but maybe you try harder. Sven Richter schrieb: > Hi, > > i have a new problem with my many-to-many field. > > I have two models A and B. > A(models.model): > b = models.ManyToManyField('app.B') > > Now when i edit A in the admi

Many-to-many column admin interface

2009-08-27 Thread Sven Richter
Hi, i have a new problem with my many-to-many field. I have two models A and B. A(models.model): b = models.ManyToManyField('app.B') Now when i edit A in the admin interface everything is ok, i can select all B instances A belongs to. What i need now is to be able to do the same thing from B'

Re: Many-to-many column

2009-08-26 Thread Sven Richter
Thank you very much. I think i get the idea. Greetings Sven On Tue, Aug 25, 2009 at 10:51 PM, Peter Bengtsson wrote: > > I fear your only option is to write a recursive function which you > feed with what you define to be "the end of the chain". > You can collect all the entries in a mutable l

Re: Many-to-many column

2009-08-25 Thread Peter Bengtsson
I fear your only option is to write a recursive function which you feed with what you define to be "the end of the chain". You can collect all the entries in a mutable list. Some example, untested, code: def get_all_parents(list_, current): for entry in current.following_to.all(): lis

Many-to-many column

2009-08-25 Thread Sven Richter
Hi, i implemented a many-to-many field in my model like: class Entries(models.Model): following_to = models.ManyToManyField('self', blank=True, null=True) Now i can get all related Entries in a template with entry.following_to.all. But i want to go deeper in relationships. Lets say i have 4 En

Re: Many to many column naming in 1.0?

2007-11-30 Thread J. Clifford Dyer
On Fri, Nov 30, 2007 at 08:16:17AM -0600, Malcolm Tredinnick wrote regarding Re: Many to many column naming in 1.0?: > > On Fri, 2007-11-30 at 07:07 -0500, J. Clifford Dyer wrote: > > Hey all, > > > > Does anyone know if there are plans to include this patch (or simil

Re: Many to many column naming in 1.0?

2007-11-30 Thread Malcolm Tredinnick
On Fri, 2007-11-30 at 07:07 -0500, J. Clifford Dyer wrote: > Hey all, > > Does anyone know if there are plans to include this patch (or similar > functionality) in Django 1.0? > > http://code.djangoproject.com/ticket/785 > > It's a relatively simple change, breaking no backwards compatibility,

Many to many column naming in 1.0?

2007-11-30 Thread J. Clifford Dyer
Hey all, Does anyone know if there are plans to include this patch (or similar functionality) in Django 1.0? http://code.djangoproject.com/ticket/785 It's a relatively simple change, breaking no backwards compatibility, and it goes a long way to making it easier to integrate legacy DBs into dja