because handling form processing is such a common task, there's a _generic_ class pre-defined for it
FormView [for forms in general], CreateView for one that creates a model instance with a modelform, and UpdateView and DeleteView [you'll guess :)]
gcain
Oh, that's different to what I saw the other day, and even cleaner again.
FunkyBob
actually, youj might also need to specify the model.... don't recall
fikka has quit
jessamynsmith has quit
gcain
So I should never copy the migrations directory to a production machine, it must create it's own one right?
Leeds has quit
FunkyBob
no no!
exactly the opposite
gcain
Oh really?
FunkyBob
you _always_ include the migrations dir
it describes how to migrate from one DB state to another
and may also include data migrations the developers have written along the way
gcain
OK, I need to go read up on that again, I've misunderstood it.
I saw it as just a cache of what's been done managed by makemigrations.
FunkyBob
no, it's not a cache
this is why "makemigrations" and "migrate" are separate steps
susame joined the channel
afk... going on a picnic with the fambly
gcain
Thanks for your help!
fikka joined the channel
jtiai joined the channel
fikka has quit
jtiai_ has quit
miz- joined the channel
isik
django.db should actually be a standalone package, I love the django orm
jessamynsmith joined the channel
iiie joined the channel
randominternetus joined the channel
fikka joined the channel
damienxx joined the channel
fikka has quit
fikka joined the channel
eb0t
hey is **kwargs the same as **extra_fields ie as long as i have **followed by a name of some sort ..it is effectively kwargs
i could say **god_bless_america
and it would effectively be == **kwargs
fikka has quit
fikka joined the channel
fikka has quit
NomadJim joined the channel
LogoS[ES] has quit
jessamynsmith has quit
randominternetus
yup
**god_bless_north_korea is the same as **kwargs. *args works the same. *args is equal to *god_bless_china
fikka joined the channel
jtiai_ joined the channel
fikka has quit
gcain
I have an insert that is causing an integrityerror because of a duplicate entry (it's defined in unique_together in the model). How do I catch the exception?
except (Model.DuplicateEntry): ?
jtiai has quit
jtiai joined the channel
jtiai_ has quit
UncleVasya joined the channel
I went with except IntegrityError as e:
nkuttler
gcain: do you use get_or_create?
gcain
No, it's a Model Form, I just used save()
nkuttler
gcain: sounds like you should catch during form validation