Re: [Django] #897: Bi-Directional ManyToMany in Admin

2024-07-22 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Emmanuel Katchy):

 * cc: Emmanuel Katchy (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190d9e6bd2d-392c782b-baed-46fc-b569-d68dd8b4f0d3-00%40eu-central-1.amazonses.com.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2024-07-21 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Comment (by Emmanuel Katchy):

 For clarity and to help whoever might take this up in the future:

 This is still an issue in Django ''5.2.dev20240621100134''.

 Given the following models


 {{{
 from django.db import models


 class Student(models.Model):
 name = models.CharField(max_length=50)
 age = models.PositiveIntegerField()

 def __str__(self) -> str:
 return self.name


 class Course(models.Model):
 name = models.CharField(max_length=20)
 students = models.ManyToManyField(
 to=Student,
 related_name="courses",
 related_query_name="course",
 )

 def __str__(self) -> str:
 return self.name

 }}}

 and the admin.py
 {{{
 from django.contrib import admin
 from django.contrib.admin import ModelAdmin

 from core.models import Course, Student


 @admin.register(Course)
 class CourseAdmin(ModelAdmin): ...


 @admin.register(Student)
 class StudentAdmin(ModelAdmin):
 filter_horizontal = [
 "course",
 ]

 }}}


 It raises an error
 {{{
 ERRORS:
 : (admin.E020) The value of
 'filter_horizontal[0]' must be a many-to-many field.
 }}}


 This error is raised by
 **django.contrib.admin.checks.BaseModelAdminChecks._check_filter_item**.

 However, getting the widget to render would require modifying
 **ModelAdmin.get_form** as well.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190d7ad837b-df123416-d3a9-4483-978a-f0107c1c0708-00%40eu-central-1.amazonses.com.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2023-07-15 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Description changed by khaled5321:

Old description:

> Allow amnytomany relationships to be defined both ways
> E.G
>
> {{{
> class ItemType(meta.Model):
> name = meta.CharField(maxlength=100)
> descritpion = meta.CharField(maxlength=250)
>
> class PropertyType(meta.Model):
> name = meta.CharField(maxlength=100)
> itemtypes = meta.ManyToManyField(ItemType)
> }}}
>
> Excellent. When I make a new property type in the admin screens I get a
> mutiselect window for item types.
>
> What I want to be able to do however is have this work back the other
> way too so that whe I create a new item i can specify what property
> types apply.
>
> Thanks

New description:

 Allow manytomany relationships to be defined both ways
 E.G

 {{{
 class ItemType(meta.Model):
 name = meta.CharField(maxlength=100)
 descritpion = meta.CharField(maxlength=250)

 class PropertyType(meta.Model):
 name = meta.CharField(maxlength=100)
 itemtypes = meta.ManyToManyField(ItemType)
 }}}

 Excellent. When I make a new property type in the admin screen I get a
 multiselect window for item types.

 What I want to be able to do however is have this work back the other
 way too so that when I create a new item I can specify what property
 types apply.

 Thanks

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701895b7e9af0-959ec9de-8330-45d1-9bef-1221200b5fc1-00%40eu-central-1.amazonses.com.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2018-09-14 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Collin Anderson):

 It can be done with inlines, but not with easy left/right select widget.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.0ba7c3727f49a04dabbcc04e3df4a05b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2018-09-13 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Ramiro Morales):

 Isn't this use case covered by this admin functionality?:
 https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#working-with-
 many-to-many-models

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3924bdc7e01c17d8e36fc91186e7e027%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2016-03-11 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by mitar):

 The form approach does not work correctly because in the history view of
 the model in admin there are no entries for changed reverse M2M fields.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3338d375c0a851491aae6e086042d65a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2016-03-11 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by mitar):

 * cc: mmitar@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1ee1e708de27d16241bfd123166c90b8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2016-03-01 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Chronial):

 This snippet provides a workaround for this: https://snipt.net/chrisdpratt
 /symmetrical-manytomany-filter-horizontal-in-django-admin/
 (and does it at the form level instead of with models)

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8b110c2d4db001a5fe768b947d4e4618%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2016-01-06 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by auvipy):

 * owner:  auvipy =>
 * status:  assigned => new


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.042e2b8939f710b90f43d8ba8f6dfa36%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2016-01-05 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  auvipy
 Type:  New feature|   Status:  assigned
Component:  contrib.admin  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by auvipy):

 * status:  new => assigned
 * owner:  nobody => auvipy
 * version:   => master


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.49d6def98c3574bd6cc227703b0c3bc4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2015-10-01 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by claudep):

 Note the "should". I'd rather see the result of #24317 once committed
 before closing this one.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.c6789b3f28e0226923378d82425abb98%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2015-10-01 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by auvipy):

 Replying to [comment:36 collinanderson]:
 > #24317 should fix this.

 then the issue should be closed?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.9af2311a1de1c69ca190e2ccff8977e6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2015-02-19 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by collinanderson):

 #24317 should fix this.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.163b949615244eb7844b8da98715a550%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2015-01-15 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by collinanderson):

 Awesome. As some have mentioned, I think the next basic step make auto
 created reverse related fields (especially ManyToManyRel) into actual
 fields.

 After that, we'd need to allow ManyToManyRel to be used in any model form.

 Here's what I think would be a start. (Doesn't work at all)
 https://github.com/django/django/pull/3927/files

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.f54c066c4f14e90763dedc601f53eccb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2015-01-15 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by jschneier):

 The new _meta options api has landed. I'm very interested in seeing this
 make it across the finish line and would be happy to do the bulk of the
 work with a little bit of direction. (Not sure where the best place to
 post that kind of query).

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3c31bbd29e45877554689b795ce85390%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2014-07-30 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by CollinAnderson):

 * cc: cmawebsite@… (added)


Comment:

 I started trying to get the patches from #10964 applying cleanly (and
 correctly) to master, but I think it's worth waiting for the new _meta
 options API. https://github.com/django/django/pull/2894

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.c8fb3d1e7b7d491b0eddd479ce3e0471%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2013-09-04 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Koen Biermans ):

 This seems to be more or less the same as #10964. I have a more generic
 solution for it on that ticket that allows you to use the reverse
 descriptor for M2M or nullable FK (like 'book_set') in the fields set for
 any modelform. It is also available in admin (also for filter_horizontal
 and filter_vertical).

 Should one of these be considered as a duplicate?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.099d2e8f747f3e3b59475cd3c5493796%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #897: Bi-Directional ManyToMany in Admin

2013-07-10 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by kux):

 For people who still bump into this, it might be worth checking
 https://github.com/kux/django-admin-extend

 It provides a mechanism for injecting bidirectional many-to-many fields in
 ModelAdmins that have already been defined by other apps.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.836229214adb9996101217950c906e75%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #897: Bi-Directional ManyToMany in Admin

2013-04-28 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by rhunwicks):

 Using Django 1.5.1 I was getting:
 {{{
 app.test1: Reverse query name for m2m field 'tests2' clashes with m2m
 field 'Test2.tests1'. Add a related_name argument to the definition for
 'tests2'
 }}}

 This is almost certainly because my field and model name is the same.
 Either way, I have solved it by adding `related_name` to `Test1.tests2`
 and taking the opportunity to suppress it from `Test2`:
 {{{
 class Test1(models.Model):
 tests2 = models.ManyToManyField('Test2', related_name='test2_set+',
 blank=True)

 class Test2(models.Model):
 tests1 = models.ReverseManyToManyField(Test1,
 through=Test1.tests2.through, blank=True)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #897: Bi-Directional ManyToMany in Admin

2012-09-28 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
 Reporter:  anonymous  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by CB):

 To update comment 28:

 This works great, but breaks south. So here's a fix for that:
 {{{
 class ReverseManyToManyField(models.ManyToManyField):
 pass
 try:
 import south
 except ImportError:
 pass
 else:
 from south.modelsinspector import add_ignored_fields
 add_ignored_fields([".*\.ReverseManyToManyField$",])

 class Test1(models.Model):
 tests2 = models.ManyToManyField('Test2', blank=True)

 class Test2(models.Model):
 tests1 = models.ReverseManyToManyField(Test1,
 through=Test1.tests2.through, blank=True)
 }}}

 A possible Django enchancement would be adding this field (or rather, the
 results of it's contribute_to_class, I think) instead of the
 ReverseManyRelatedObjectsDescriptor

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-07-06 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+---
   Reporter:  anonymous|  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:   |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by anonymous):

 Check this out

 {{{
 class Test1(models.Model):
 tests2 = models.ManyToManyField('Test2', blank=True)

 class Test2(models.Model):
 tests1 = models.ManyToManyField(Test1, through=Test1.tests2.through,
 blank=True)
 }}}

 I guess this is the most native way

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-06-14 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+---
   Reporter:  anonymous|  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:   |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---
Changes (by croepha):

 * ui_ux:   => 0


Comment:

 etienned's solution did not work for me, I am doing this instead:

 {{{

 class User(models.Model):
 groups = models.ManyToManyField('Group',
 db_table='testapp_user_groups')

 class Group(models.Model):
 users = models.ManyToManyField('User',
 db_table=User.groups.field.db_table)
 Group.users.through._meta.managed = False
 }}}


 This will also work for non symmetrical self M2M relationships:
 {{{

 class User(models.Model):
   supervisors = models.ManyToManyField('self',
 related_name='underlings_set', db_table='testapp_user_supervisors')
   underlings = models.ManyToManyField('self',
 related_name='supervisors_set', db_table=supervisors.db_table)
   underlings._get_m2m_attr = supervisors._get_m2m_reverse_attr
   underlings._get_m2m_reverse_attr = supervisors._get_m2m_attr
 User.underlings.through._meta.managed = False
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-05-18 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+---
   Reporter:  anonymous|  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:   |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by CarstenF):

 * cc: carsten.fuchs@… (added)
 * easy:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-04-01 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+-
   Reporter:  anonymous|Owner:  nobody
   Type:  New feature  |   Status:  new
  Milestone:   |Component:  contrib.admin
Version:   | Severity:  Normal
 Resolution:   | Keywords:
   Triage Stage:  Accepted |Has patch:  0
Needs documentation:  0|  Needs tests:  0
Patch needs improvement:  0|
---+-
Changes (by lrekucki):

 * type:  enhancement => New feature
 * severity:  normal => Normal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-02-26 Thread Django
#897: Bi-Directional ManyToMany in Admin
+---
   Reporter:  anonymous | Owner:  nobody
 Status:  new   | Milestone:
  Component:  django.contrib.admin  |   Version:
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---
Changes (by kmike):

 * cc: kmike84@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-01-26 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by etienned):

 I found a solution that works with 1.2. Here it is:

 {{{
 #!python
 class User(models.Model):
 groups = models.ManyToManyField('Group', through='UserGroups')

 class Group(models.Model):
 users = models.ManyToManyField('User', through='UserGroups')

 class UserGroups(models.Model):
 user = models.ForeignKey(User)
 group = models.ForeignKey(Group)

 class Meta:
 db_table = 'app_user_groups'
 auto_created = User

 }}}

 This way ''syncdb'' create the ''UserGroups'' table only one time (because
 ''users'' and ''groups'' have ''through'' as argument) but the admin think
 is ''auto_created'' so it show the ''ManyToManyField'' directly for both
 ''User'' and ''Group''.

 But that's definitely a lot of trouble to have the field in both model
 admin pages. I don't think the solution is to modified ''syncdb'' either.
 I think russellm's suggestions are good avenues.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-01-25 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by anonymous):

 Replying to [comment:21 anonymous]:
 > Replying to [comment:17 ericholscher]:
 > > Just ran into this bug as well. I'll probably take a stab at fixing it
 in the next couple of days, as it is rather annoying. Though I'm curious
 if it might break expectations of people in existing setups.
 >
 > To fix it for 1.2, all needed is to change:
 >
 > {{{
 > self.creates_table = False
 > }}}
 >

 Forget this solution, it doesn't work. Sorry for the noise.
 > to:
 >
 > {{{
 > self.auto_created = False
 > }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2011-01-25 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by anonymous):

 Replying to [comment:17 ericholscher]:
 > Just ran into this bug as well. I'll probably take a stab at fixing it
 in the next couple of days, as it is rather annoying. Though I'm curious
 if it might break expectations of people in existing setups.

 To fix it for 1.2, all needed is to change:

 {{{
 self.creates_table = False
 }}}

 to:

 {{{
 self.auto_created = False
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2010-09-23 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by russellm):

 There's at least one simple approach for backwards compatibility: reverse
 m2ms are only included if they are explicitly listed in the fields list.
 Alternatively, we add an 'include_reverse_m2m' flag.

 For 2.0, we can consider dropping the flag and making reverse m2m the
 default. It's a little inconvenient, but that's the price of backwards
 compatibility.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2010-09-23 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by Alex):

 Err, that was Carl Meyer who suggested it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2010-09-23 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by ericholscher):

 I talked to Alex Gaynor, and he mentioned ManytoMany inlines, which will
 solve this problem in a lot of cases.

 http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-many-
 to-many-models

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2010-09-23 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by ericholscher):

 Just ran into this bug as well. I'll probably take a stab at fixing it in
 the next couple of days, as it is rather annoying. Though I'm curious if
 it might break expectations of people in existing setups.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2010-08-22 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by buchuki):

 Doesn't look like there's been much activity on this bug for a while, but
 I'd like to point out that the workaround posted by anonymous (Django
 snippet #1295) no longer works with Django 1.2. I have been unable to find
 any other workarounds.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2009-04-25 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody 
  
Status:  new   | Milestone: 
  
 Component:  django.contrib.admin  |   Version: 
  
Resolution:|  Keywords:  
gsoc09-admin-refactor
 Stage:  Accepted  | Has_patch:  0  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by mrts):

  * keywords:  => gsoc09-admin-refactor

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2009-01-22 Thread Django
#897: Bi-Directional ManyToMany in Admin
---+
  Reporter:  anonymous | Owner:  nobody  
Status:  new   | Milestone:  post-1.0
 Component:  django.contrib.admin  |   Version:  
Resolution:|  Keywords:  
 Stage:  Accepted  | Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by anonymous):

 Some kind fellow posted a workaround on django snippets.
 http://www.djangosnippets.org/snippets/1295/

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2007-01-16 Thread Django

#897: Bi-Directional ManyToMany in Admin
-+--
Reporter:  anonymous|Owner:  adrian
Type:  enhancement  |   Status:  new   
Priority:  low  |Milestone:
Component:  Admin interface  |  Version:
Severity:  normal   |   Resolution:
Keywords:   |  
-+--

Changes (by Gary Wilson <[EMAIL PROTECTED]>):

 * summary:  Bi-Directional ManyToMany => Bi-Directional ManyToMany in
 Admin

Comment:



--
Ticket URL: 
Django 
The web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django 
updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #897: Bi-Directional ManyToMany in Admin

2007-01-16 Thread Django

#897: Bi-Directional ManyToMany in Admin
-+--
Reporter:  anonymous|Owner:  adrian
Type:  enhancement  |   Status:  new   
Priority:  low  |Milestone:
Component:  Admin interface  |  Version:
Severity:  normal   |   Resolution:
Keywords:   |  
-+--

Comment (by Gary Wilson <[EMAIL PROTECTED]>):

#2648 marked as duplicate of this.

--
Ticket URL: 
Django 
The web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django 
updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---