﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1499	records with foreignkey do not change after an edit from parent  page	pascalbarbedor@…	Adrian Holovaty	"I tried the example Poll choices from the tutorial and it works.
ie if i change a choice from poll page it is updated


 now with this model
which seem to me is completely equivalent, any edit that concern data from rubrique page is silently ignored
but if i put wrong entry in the fields i still have the error page.



{{{
SUPPORT_CHOICES = (
('PCS', 'PCS'),
('ROME', 'ROME'),
('FAP', 'FAP'),
('NSF', 'NSF'),
('PRODUIT', 'FORMATION'),
('TITRE', 'TITRE'),
('IDSSC', 'sous secteur'),
('FORMAC', 'formacode'),
('NAF', 'NAF'),
)




THEME_CHOICES = (
('MDT', 'Emploi, Marché du travail'),
('AFPA', 'Formations AFPA'),
('OBS', 'Observatoires'),
('CERT', 'Diplômes, Certification'),
('FC', 'Formation continue'),
)



ZONE_CHOICES = (
(1, 'France'),
(3, 'Régions'),
(7, 'Départements'),
(11, 'Zones d''emploi'),
(15,'Zones d''emploi et départements'),
(31,'Centres de formation'),
)


class Rubrique( meta.Model):
    theme = meta.CharField(maxlength=150, choices=THEME_CHOICES)
    rubrique = meta.CharField( 'rubrique', maxlength=50)
    info = meta.TextField(maxlength=100, blank=True)
    def __repr__(self):
        return self.rubrique

    class META:
        admin = meta.Admin(
            list_display = ( 'rubrique','theme', 'info'),
        )



class Data( meta.Model):
    data = meta.CharField( maxlength=15,  core=True)
    
    rubrique = meta.ForeignKey(Rubrique, edit_inline=meta.TABULAR, num_in_admin=10)
    
    lb = meta.CharField( 'label', maxlength=60, core=True)
    lc = meta.CharField('label court', maxlength=20, core=True, blank=True)
    source = meta.CharField( maxlength=20, core=True, blank=True)
    table = meta.CharField( maxlength=20, core=True, blank=True)
    tfield = meta.CharField( maxlength=20, core=True, blank=True)
    support = meta.CharField(maxlength=15, choices=SUPPORT_CHOICES, core=True, blank=True)

    zones = meta.IntegerField( maxlength=20, choices=ZONE_CHOICES, core=True, blank=True)
    #~ class META:
        #~ admin = meta.Admin(
            #~ list_display = ('rubrique','data', 'lb','lc', 'source','table','tfield','support','zones'),
        #~ )

    def __repr__(self):
        return ""%s [%s]"" % (self.lb, self.data)

    
}}}"	defect	new	contrib.admin		normal				Unreviewed	0	0	0	0	0	0
