[Fixed]-ModelForm field not showing


managed to skip the rendering. I’m able to access the primary key via the “inital” attribute when I’m iterating all the devices:

{{ device.modbus_devices.initial.ixModbusDevice }}


Because it’s an AutoField. Your can’t set those; they are automatically assigned by the database, hence the name. Therefore there’s no point in showing then on the form.


Try change the return to :

return render(
         'title':'Create BACnetDevice',
         'devices': devices

render() is the same as a call to render_to_response() with a
context_instance argument that forces the use of a RequestContext.

Render Shortcut

Leave a comment