Found solution.

Add form to admin.TabularInline:

class CriteriaPlacesInlineAdmin(admin.TabularInline):
    model = PlacesToCriterias
    form = CriteriaPlacesChoicesFieldForm  # <- ADDED FORM
class CriteriasAdmin(admin.ModelAdmin):
    inlines = [CriteriaPlacesInlineAdmin], CriteriasAdmin)


class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
    ct_place_type = ContentType.objects.get_for_model(PlaceTypesGroups)

    object_id = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
    content_type = forms.ModelChoiceField(ContentType.objects.all(), 
initial=ct_place_type, widget=forms.HiddenInput())

    def clean_object_id(self):
        return self.cleaned_data['object_id'].pk

    def clean_content_type(self):
        return self.ct_place_type

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 post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to