Re: second level nested inlines not showing in django-nested-inlines

2015-05-03 Thread H M
hi, did you solved the problem?

On Wednesday, April 16, 2014 at 7:59:10 AM UTC+2, Andreas Bloch wrote:
>
> I'm trying to add a nested admin interface using 
> https://github.com/s-block/django-nested-inline *but the 2nd level is not 
> showing up in the admin*...
>
> I have a foreign key relationship between three models:
>
> ContractTemplate => ContractClause => ContractSubClauses
>
> (i.e. a template can have many clauses and every clause can have many 
> sub-clauses)
>
> *models.py*
>
> class ContractTemplate(models.Model):
> name = models.CharField()
> ...
> class ContractClause(models.Model):
> contract_template = models.ForeignKey(ContractTemplate)
> title = models.CharField()
> ...
> class ContractSubClauses(models.Model):
> contract_clause = models.ForeignKey(ContractClause)
> text = models.TextField()
> ...
>
> *admin.py*
>
> from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, 
> NestedTabularInline
>
> class ContractSubClauseInline(NestedTabularInline):
> model = ContractSubClause
> class ContractClauseInline(NestedStackedInline):
> model = ContractClause
> inlines = [ContractSubClauseInline]
> class ContractTemplateAdmin(NestedModelAdmin):
> inlines = [ContractClauseInline]
>
> admin.site.register(ContractTemplate, ContractTemplateAdmin)
>
> --
>
>
> This is how the admin looks (first level - ContractClause - shows, but 
> ContractSubClause(s) are not showing):
>
>
> 
>
> What is missing to show the ContractSubClause(s)?
>
>

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ff032580-5505-46bb-b466-898b41207770%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: second level nested inlines not showing in django-nested-inlines

2014-06-16 Thread Hangloser Firestarter
Someone managed to solve this problem?

I have this problem, too. The level 1 is OK, but level 2 not functionate!

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e87379c-66c1-42a5-82bd-5ed3a27cf5f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-05-22 Thread Thiago borges dos reis
Joris, i agree with you!


2014-05-22 15:42 GMT-03:00 Joris <jmailli...@promani.be>:

>
> I didn't get it to work either. First I got an error from one of the
> source files, which I fixed, and then it still didn't work.
> I'm using Grappelli though, thought that could be a reason for the problem.
>
> No Thiago it's not silver bullet but still it's pretty good :) and the
> existance of such an addon would lead to believe at least someone got it to
> work, right :-)
>
> J
>
>
> op 22-05-14 17:10, Thiago borges dos reis schreef:
>
> The truth is that django isn't the silver bullet. In the moment, i think
> it doesn't really work. I'm doing my own "admin".
>
>
>  2014-05-22 6:08 GMT-03:00 Vivi Blubb <v.lieu...@gmail.com>:
>
>> Hi,
>>
>> I do have the same problem. I'm using Python 2.7.5 and Django 1.6.5. I
>> followed the tutorials of nested inlines, but it doesn't work. There is no
>> error message, but it does not show the third inline.
>> Actually there was a bug, because many did have the same problem, but
>> still I couldnt find the right solution.
>>
>> Did someone solved that now?
>>
>> Am Mittwoch, 12. März 2014 21:48:05 UTC+1 schrieb Thiago borges dos reis:
>>
>>> Someone knows how to use django-nested-inlines.
>>>
>>> I did this:
>>>
>>> from django.contrib import admin
>>> from nested_inlines.admin import
>>> NestedStackedInline,NestedModelAdmin,NestedTabularInline
>>> from models import Dieta, Cliente,Refeicao,Opcao
>>>
>>>
>>> admin.site.register(Cliente)
>>>
>>>
>>> class OpcaoInLine(NestedStackedInline):
>>> model = Opcao
>>> extra = 1
>>>
>>> class RefeicaoInLine(NestedStackedInline):
>>> model = Refeicao
>>> extra = 1
>>> inlines = [OpcaoInLine,]
>>>
>>>
>>> class DietaAdmin(NestedModelAdmin):
>>>
>>> fields= ('cliente','data_de_publicacao')
>>>
>>> inlines = [RefeicaoInLine,]
>>>
>>>
>>>
>>>
>>> admin.site.register(Dieta,DietaAdmin)
>>>
>>>
>>>
>>> ---Didn't work
>>>
>>--
>> 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, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>>  To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com<https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com?utm_medium=email_source=footer>.
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHQaGTCbFYETHVBX5kWJn0jh7VYcLy1LC4srYmbfggL0HD7eog%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAHQaGTCbFYETHVBX5kWJn0jh7VYcLy1LC4srYmbfggL0HD7eog%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> 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, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/537E4506.9020506%40promani.be<https://groups.google.com/d/msgid/django-users/537E4506.9020506%40promani.be?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHQaGTCr6EuCotjuqk3HAQQkBydjtLHBWVSojTwew7T7HBjpCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-05-22 Thread Joris


I didn't get it to work either. First I got an error from one of the 
source files, which I fixed, and then it still didn't work.

I'm using Grappelli though, thought that could be a reason for the problem.

No Thiago it's not silver bullet but still it's pretty good :) and the 
existance of such an addon would lead to believe at least someone got it 
to work, right :-)


J


op 22-05-14 17:10, Thiago borges dos reis schreef:
The truth is that django isn't the silver bullet. In the moment, i 
think it doesn't really work. I'm doing my own "admin".



2014-05-22 6:08 GMT-03:00 Vivi Blubb <v.lieu...@gmail.com 
<mailto:v.lieu...@gmail.com>>:


Hi,

I do have the same problem. I'm using Python 2.7.5 and Django
1.6.5. I followed the tutorials of nested inlines, but it doesn't
work. There is no error message, but it does not show the third
inline.
Actually there was a bug, because many did have the same problem,
but still I couldnt find the right solution.

Did someone solved that now?

Am Mittwoch, 12. März 2014 21:48:05 UTC+1 schrieb Thiago borges
dos reis:

Someone knows how to use django-nested-inlines.

I did this:

from django.contrib import admin
from nested_inlines.admin import
NestedStackedInline,NestedModelAdmin,NestedTabularInline
from models import Dieta, Cliente,Refeicao,Opcao


admin.site.register(Cliente)


class OpcaoInLine(NestedStackedInline):
model = Opcao
extra = 1

class RefeicaoInLine(NestedStackedInline):
model = Refeicao
extra = 1
inlines = [OpcaoInLine,]


class DietaAdmin(NestedModelAdmin):

fields= ('cliente','data_de_publicacao')

inlines = [RefeicaoInLine,]




admin.site.register(Dieta,DietaAdmin)



---Didn't work

-- 
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com?utm_medium=email_source=footer>.


For more options, visit https://groups.google.com/d/optout.


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHQaGTCbFYETHVBX5kWJn0jh7VYcLy1LC4srYmbfggL0HD7eog%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAHQaGTCbFYETHVBX5kWJn0jh7VYcLy1LC4srYmbfggL0HD7eog%40mail.gmail.com?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/537E4506.9020506%40promani.be.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-05-22 Thread Thiago borges dos reis
The truth is that django isn't the silver bullet. In the moment, i think it
doesn't really work. I'm doing my own "admin".


2014-05-22 6:08 GMT-03:00 Vivi Blubb <v.lieu...@gmail.com>:

> Hi,
>
> I do have the same problem. I'm using Python 2.7.5 and Django 1.6.5. I
> followed the tutorials of nested inlines, but it doesn't work. There is no
> error message, but it does not show the third inline.
> Actually there was a bug, because many did have the same problem, but
> still I couldnt find the right solution.
>
> Did someone solved that now?
>
> Am Mittwoch, 12. März 2014 21:48:05 UTC+1 schrieb Thiago borges dos reis:
>
>> Someone knows how to use django-nested-inlines.
>>
>> I did this:
>>
>> from django.contrib import admin
>> from nested_inlines.admin import NestedStackedInline,NestedModelAdmin,
>> NestedTabularInline
>> from models import Dieta, Cliente,Refeicao,Opcao
>>
>>
>> admin.site.register(Cliente)
>>
>>
>> class OpcaoInLine(NestedStackedInline):
>> model = Opcao
>> extra = 1
>>
>> class RefeicaoInLine(NestedStackedInline):
>> model = Refeicao
>> extra = 1
>> inlines = [OpcaoInLine,]
>>
>>
>> class DietaAdmin(NestedModelAdmin):
>>
>> fields= ('cliente','data_de_publicacao')
>>
>> inlines = [RefeicaoInLine,]
>>
>>
>>
>>
>> admin.site.register(Dieta,DietaAdmin)
>>
>>
>>
>> ---Didn't work
>>
>  --
> 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, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com<https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHQaGTCbFYETHVBX5kWJn0jh7VYcLy1LC4srYmbfggL0HD7eog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-05-22 Thread Vivi Blubb
Hi,

I do have the same problem. I'm using Python 2.7.5 and Django 1.6.5. I 
followed the tutorials of nested inlines, but it doesn't work. There is no 
error message, but it does not show the third inline.
Actually there was a bug, because many did have the same problem, but still 
I couldnt find the right solution.

Did someone solved that now?

Am Mittwoch, 12. März 2014 21:48:05 UTC+1 schrieb Thiago borges dos reis:
>
> Someone knows how to use django-nested-inlines.
>
> I did this:
>
> from django.contrib import admin
> from nested_inlines.admin import 
> NestedStackedInline,NestedModelAdmin,NestedTabularInline
> from models import Dieta, Cliente,Refeicao,Opcao
>
>
> admin.site.register(Cliente)
>
>
> class OpcaoInLine(NestedStackedInline):
> model = Opcao
> extra = 1
>
> class RefeicaoInLine(NestedStackedInline):
> model = Refeicao
> extra = 1
> inlines = [OpcaoInLine,]
>
>
> class DietaAdmin(NestedModelAdmin):
>
> fields= ('cliente','data_de_publicacao')
>
> inlines = [RefeicaoInLine,]
>
>
>
>
> admin.site.register(Dieta,DietaAdmin)
>
>
>
> ---Didn't work
>

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f69ac9ee-502f-453e-8918-91a9675a9914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


second level nested inlines not showing in django-nested-inlines

2014-04-16 Thread Andreas Bloch


I'm trying to add a nested admin interface using 
https://github.com/s-block/django-nested-inline *but the 2nd level is not 
showing up in the admin*...

I have a foreign key relationship between three models:

ContractTemplate => ContractClause => ContractSubClauses

(i.e. a template can have many clauses and every clause can have many 
sub-clauses)

*models.py*

class ContractTemplate(models.Model):
name = models.CharField()
...
class ContractClause(models.Model):
contract_template = models.ForeignKey(ContractTemplate)
title = models.CharField()
...
class ContractSubClauses(models.Model):
contract_clause = models.ForeignKey(ContractClause)
text = models.TextField()
...

*admin.py*

from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, 
NestedTabularInline

class ContractSubClauseInline(NestedTabularInline):
model = ContractSubClause
class ContractClauseInline(NestedStackedInline):
model = ContractClause
inlines = [ContractSubClauseInline]
class ContractTemplateAdmin(NestedModelAdmin):
inlines = [ContractClauseInline]

admin.site.register(ContractTemplate, ContractTemplateAdmin)

--


This is how the admin looks (first level - ContractClause - shows, but 
ContractSubClause(s) are not showing):



What is missing to show the ContractSubClause(s)?

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27ac4b42-072c-4e6a-b15d-2d7ef5c3967f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-03-14 Thread Thiago borges dos reis
the forms are not nested.



2014-03-14 10:01 GMT-03:00 Camilo Torres :

>
> On Wednesday, March 12, 2014 4:18:05 PM UTC-4:30, Thiago borges dos reis
> wrote:
>>
>> from django.contrib import admin
>> from nested_inlines.admin import NestedStackedInline,NestedModelAdmin,
>> NestedTabularInline
>> from models import Dieta, Cliente,Refeicao,Opcao
>>
>>
>> admin.site.register(Cliente)
>>
>>
>> class OpcaoInLine(NestedStackedInline):
>> model = Opcao
>> extra = 1
>>
>> class RefeicaoInLine(NestedStackedInline):
>> model = Refeicao
>> extra = 1
>> inlines = [OpcaoInLine,]
>>
>>
>> class DietaAdmin(NestedModelAdmin):
>>
>> fields= ('cliente','data_de_publicacao')
>>
>> inlines = [RefeicaoInLine,]
>>
>>
>>
>>
>> admin.site.register(Dieta,DietaAdmin)
>>
>>
>>
>> ---Didn't work
>>
> Hello,
>
> You forgot to indicate here:
> * What is your error? (backtrace)
> * Version of Django, etc.
>
> Regards,
> Camilo
>
> --
> 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, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9f7daa37-60ee-48e1-88d1-bf45dc289af1%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHQaGTDLNkoKV-bOWHAO7r8Z-tPPWc2QhqtuSGy1DFVkF1Wwxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-nested-inlines

2014-03-14 Thread Camilo Torres

On Wednesday, March 12, 2014 4:18:05 PM UTC-4:30, Thiago borges dos reis 
wrote:
>
> from django.contrib import admin
> from nested_inlines.admin import 
> NestedStackedInline,NestedModelAdmin,NestedTabularInline
> from models import Dieta, Cliente,Refeicao,Opcao
>
>
> admin.site.register(Cliente)
>
>
> class OpcaoInLine(NestedStackedInline):
> model = Opcao
> extra = 1
>
> class RefeicaoInLine(NestedStackedInline):
> model = Refeicao
> extra = 1
> inlines = [OpcaoInLine,]
>
>
> class DietaAdmin(NestedModelAdmin):
>
> fields= ('cliente','data_de_publicacao')
>
> inlines = [RefeicaoInLine,]
>
>
>
>
> admin.site.register(Dieta,DietaAdmin)
>
>
>
> ---Didn't work
>
Hello,

You forgot to indicate here:
* What is your error? (backtrace)
* Version of Django, etc.

Regards,
Camilo

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f7daa37-60ee-48e1-88d1-bf45dc289af1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django-nested-inlines

2014-03-12 Thread Thiago borges dos reis
Someone knows how to use django-nested-inlines.

I did this:

from django.contrib import admin
from nested_inlines.admin import 
NestedStackedInline,NestedModelAdmin,NestedTabularInline
from models import Dieta, Cliente,Refeicao,Opcao


admin.site.register(Cliente)


class OpcaoInLine(NestedStackedInline):
model = Opcao
extra = 1

class RefeicaoInLine(NestedStackedInline):
model = Refeicao
extra = 1
inlines = [OpcaoInLine,]


class DietaAdmin(NestedModelAdmin):

fields= ('cliente','data_de_publicacao')

inlines = [RefeicaoInLine,]




admin.site.register(Dieta,DietaAdmin)



---Didn't work

-- 
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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5133b890-4663-4c2e-a4cc-2ffa9c35e1e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


nested inlines

2009-10-05 Thread Marek Pietrucha

Hello,

Has anyone achieved something like nested inlines in the admin pages?
Does anybody know about solutions to this matter? I know there is a
patch for older versions of django but not only there are no new ones
but also they didn't support editing (which makes it unusable).

best regards,
mp

P.S. this is the ticket regarding this matter: 
http://code.djangoproject.com/ticket/9025
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Nested Inlines / Multiple ManyToMany field admin support

2009-09-09 Thread Mike W.

Hey guys.  I looked around this group & the web for an answer to this
question, but I can't seem to find one.

My application has Publications, which have multiple Authors. Each
Author has one Person, but each Auther can have multiple
Institutions.  (This is an app to keep track of academic publications,
for some background info). See my (abbreviated) models towards the
end.

I want to use the custom admin, but I can't seem to get it to work
with the Nested ManyToManyFields.  I can get it to inline the Author
field inside the Publication admin, but I also want to be able to edit
each Author's institutions from the publication admin. Is this
possible?  In other words, does Admin support ManyToMany fields inside
of an Inline adminmodel?

Thanks much,
Mike

Models below-


So we have it set up like this:

class Publication(Unit):
title = models.CharField(max_length=200)
authors = models.ManyToManyField
(Person,blank=True,null=True,through="Author")

class Institution(models.Model):
name = models.CharField(max_length=200)
location = models.ForeignKey(Location, blank=True, null=True)

class Author(models.Model):
person = models.ForeignKey(Person)
publication = models.ForeignKey(Publication)
order = models.PositiveIntegerField(blank=True,null=True)
institutes = models.ManyToManyField
(Institution,blank=True,null=True,through="AuthorInstitutes")

class AuthorInstitutes(models.Model):
institute = models.ForeignKey(Institution)
author = models.ForeignKey(Author)
rank = models.CharField(max_length=3, choices=RANK_CHOICES)

class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100,blank=True,null=True)

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nested Inlines, dynamic forms, templates and all sorts of problems.

2007-10-10 Thread [EMAIL PROTECTED]

Hi yml,

On 9 Oct, 20:11, yml <[EMAIL PROTECTED]> wrote:
> In a very similar situation I have chosen option 2 for the following
> reasons:
>  * the code was much more simple, at least simpler to maintain for me
>  * Very hight control on the layout of the form.

Thanks for the reply. I think I'll do likewise; I realised that I can
still use newforms fragments for validation.

Regards,

Felix


--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nested Inlines, dynamic forms, templates and all sorts of problems.

2007-10-09 Thread yml

Hello Felix,
In a very similar situation I have chosen option 2 for the following
reasons:
 * the code was much more simple, at least simpler to maintain for me
 * Very hight control on the layout of the form.

I have taken this decision after spending several days working on a
"newform" based solution. And just for the record the newform solution
was working fine but was more complex to maintain/debug.

Regards,
--yml


On 9 oct, 18:11, "Felix Ingram" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've been making great strides with my application since returning
> from the land of Pylons. Given that the app is all about data entry
> I've taken the customise-the-admin-app approach to things and made the
> switch to newforms-admin this morning.
>
> So far things are working: data is being entered and I've even got
> things rendering into ODT and DOCX.
>
> I've now got a little stuck, however. I have three models: Report,
> Section and Pictures. Sections are pieces of boilerplate which are
> added to a report and pictures are added to a section. Currently
> sections are edited inline with reports and pictures are edited inline
> with sections.
>
> What I would like to do is allow users to add sections and pictures to
> a report at the same time (effectively nested inlines).
>
> In models:
>
> class Report(...):
> fields...
>
> class Section(...):
> report = ForeignKey(Report,  ...)
>
> class Picture(...):
> section = ForeignKey(Section, ...)
>
> I'm trying to decide on the best way to do this. I've come up with a
> few possible options and would appreciate any pointers about which
> would be the best (or worst).
>
> 1. Create a dynamic newform.
> This way gets all of the required fields onto the screen but I'd like
> to be able to group things in fieldsets and do non-simple layouts. I
> tried to create a template but ran into trouble as I didn't know the
> number of fields or how to test the name of the fields being looped
> over in order to group them.
>
> 2. Create the template by hand.
> I can just pass my report instance to the template and create the form
> manually but then I lose the magic of validation (which would probably
> mean I'd end up using formencode or similar).
>
> 3. Add a pop up to the current template.
> This would allow the user to create the section and then open a pop up
> to do the pictures. There are problems with ensuring the section is
> valid and saved first, however.
>
> 4. Mystery fourth option that I should have been using all along.
> I don't know much about this one; anyone any ideas?
>
> If any one's had to implement something similar then I'd appreciate
> any advice. Any thoughts or ideas would also be gratefully received.
>
> Regards,
>
> Felix


--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Nested Inlines, dynamic forms, templates and all sorts of problems.

2007-10-09 Thread Felix Ingram

Hello all,

I've been making great strides with my application since returning
from the land of Pylons. Given that the app is all about data entry
I've taken the customise-the-admin-app approach to things and made the
switch to newforms-admin this morning.

So far things are working: data is being entered and I've even got
things rendering into ODT and DOCX.

I've now got a little stuck, however. I have three models: Report,
Section and Pictures. Sections are pieces of boilerplate which are
added to a report and pictures are added to a section. Currently
sections are edited inline with reports and pictures are edited inline
with sections.

What I would like to do is allow users to add sections and pictures to
a report at the same time (effectively nested inlines).

In models:

class Report(...):
fields...

class Section(...):
report = ForeignKey(Report,  ...)

class Picture(...):
section = ForeignKey(Section, ...)

I'm trying to decide on the best way to do this. I've come up with a
few possible options and would appreciate any pointers about which
would be the best (or worst).

1. Create a dynamic newform.
This way gets all of the required fields onto the screen but I'd like
to be able to group things in fieldsets and do non-simple layouts. I
tried to create a template but ran into trouble as I didn't know the
number of fields or how to test the name of the fields being looped
over in order to group them.

2. Create the template by hand.
I can just pass my report instance to the template and create the form
manually but then I lose the magic of validation (which would probably
mean I'd end up using formencode or similar).

3. Add a pop up to the current template.
This would allow the user to create the section and then open a pop up
to do the pictures. There are problems with ensuring the section is
valid and saved first, however.

4. Mystery fourth option that I should have been using all along.
I don't know much about this one; anyone any ideas?

If any one's had to implement something similar then I'd appreciate
any advice. Any thoughts or ideas would also be gratefully received.

Regards,

Felix

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---