mattmcc, Is using something like "logging.getLogger('myProject.' + __name__)" common? I'm asking also because perhaps I can find a way to not have to write 'myProject' in every file
PantelicGR has quit
PantelicGR joined the channel
jaykay has quit
jaykay joined the channel
fikka joined the channel
michelem joined the channel
fikka has quit
rsrx joined the channel
Haudegen joined the channel
mattmcc
ovalseven8: Well, you can't have it both ways. Either you prefix the logger name in every file, or you spell out each top-level module in your logging config.
The latter is certainly less work if you have a few apps that have a lot of files.
But there's something to be said for a common namespace across your apps that lets you manage their logging uniformly.
having looked a bit deeper , it seems i could have used django.views.generic.edit.CreateView
thiras has quit
under what circumstances would it have been better to use CreateView
rpkilby has quit
i dont really get the reasoning behind which i SHOULD have chosen
both ask for a form
both validate
jtiai
In general genereic views are meant to remove boilerplate.
fikka joined the channel
eb0t
ah..so for my view which is just an enquiry form...would you have used a generic view jtiai
jtiai
I have never used generic views :)
eb0t
ah ok ...you want control over like everything
mattmcc
There's a FormView class that'd probably be useful.
jtiai
My apps are mostly SPA and uses REST interfaces.
eb0t
the formview class ....you can have model forms so that too is a bit tricky
if you already got models
ah it seems that most of my views the function views ..i could have used formview
mattmcc
If you're working with a model, then I wouldn't use FormView.
fikka has quit
eb0t
hmm ...when i was working with a model..eg for a cv send form...i used a function which called a template...but then created a forms.modelform for validation and saving
jtiai
True, and you had to write a code for all that.
If you have tens of forms you would be writing pretty much the same boilerplate over and over again.
eb0t
ah yes
thiras joined the channel
greg_f joined the channel
ovalseven8 has quit
greatgatsby joined the channel
PantelicGR has quit
fikka joined the channel
fikka has quit
mra90 joined the channel
fikka joined the channel
lobo_d_b has quit
fikka has quit
czart joined the channel
theology joined the channel
xliiv joined the channel
theology has quit
nix64bit has quit
xliiv
i've got foreignkey in admin inline and extra=3, and for each form foreignkey options are taken from db, i don't see option for caching it
mattmcc
Yeah, out of the box it re-queries those choices for each form in the formset.
xliiv
mattmcc, how do you walkaround that? :)
fikka joined the channel
btw. i've seen that select2 is integrated with django2.x, can it be enabled for inline, maybe this would solve that in my case?