eccentric_j: something like OnboardingVenue.objects.filter(user__groups__company__merchants__isnull=False, is_active=True)
I had to mess a little with models, so that related expression may need tweaking
eccentric_j
Oooh that still gives me a really good direction to go in. Thanks very much for wrestling with it!
jessamynsmith
:)
DodgeThis has quit
will_ joined the channel
eblip
why in django does a choices field have a short version to be stored in db...what is the benefit of that
YEAR_IN_SCHOOL_CHOICES = (
('FR', 'Freshman'),YY
foul_owl joined the channel
jessamynsmith
eblip: It gives you options, like supporting legacy database systems, or minimizing storage space.
in general it's a good idea to separate what's stored from what's displayed
eblip
ah ok, i can see it saving a little space..but when you display the details...you will be displayed FR
rather than Freshman, and this may be confusing for someone who doesnt know about these matters
jessamynsmith
depends how you access it
if you use a default modelform, it'll use the display name
(unless you override it)
eccentric_j
A select HTML element works similarly `<option value="10">Freshman</option><option value="11">Junior</option><option value="12">Senior</option>`. The idea is you can use labels your users recognize that powers data you can work with
jessamynsmith
you can access the display name yourself with get_<FIELD_NAME>_display()
what's a good approach on using atomic transactions, while using a post save signal?
eblip
thanks ill take a look at that
jessamynsmith
ironi: I'm not sure you can... I think if you want atomicity you might need to look at overriding the save() method
audioburn has quit
bradfordli123 joined the channel
ironi
i.e. I create model Foo and then 2 instances of model Bar with fk to model Foo, within a transaction.atomic block - and then I want the post save for Foo to be emitted after theentire transaction is done
Xiti joined the channel
jessamynsmith: is maybe transaction.on_commit(lambda: signal_receiver(foo.id) the way to go instead of using post_save signals?
jessamynsmith
ironi: I feel like we need somebody more versed than I in the intricacies of django and transactions
maybe knbk
ironi
and then get the instance from the db with a select_related(Bar)
I would like to avoid doing another request bound db query though
bradfordli123 has quit
techalchemy joined the channel
BSLang joined the channel
jessamynsmith has quit
Yen has quit
Yen joined the channel
hanetzer
is there a 'legal' way to get say uptime/disk space usage within a django app?
FunkyBob
ask your os?
rajesh has quit
bradfordli123 joined the channel
chasonchaffin joined the channel
eperzhand joined the channel
g00se joined the channel
CtrlC has quit
hanetzer
FunkyBob: yeah, obvs, but was wondering if there was a particularly standard way to do it.
the-dingo joined the channel
moldy
hanetzer: no. the most standard way would be to assume there is no such thing
hanetzer
moldy: gotcha.
the-dingo
I have a weird problem. I have an app created by django 2.1 and the models have the view permissions, but one created with 2.0 does not and both live on the same project. Is this a knows bug or something?
chasonchaffin has quit
moldy
hanetzer: also, uptime and disk space usage are **very** different things. which real-world problem do you want to solve?
hanetzer
moldy: recreate daloradius in django. so, hopefully getting feature parity
they have it, so I was wondering about it myself.
ram0n has quit
calling it djaloradius for now :)
moldy
hanetzer: not familiar with daloradius. sometimes the best thing to do is not to do something.
hanetzer
yep. just idle curiosity, as that wouldn't be crucial to the operation of it
'authdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' how would I go about this?
the-dingo has quit
djapo joined the channel
moretango joined the channel
theo_moore has quit
moretango
Is get_absolute_url() still useful if your views are served over API's and you have a completely decoupled frontend?
hylje
you might still want to produce links in the API
moretango
sounds good
buff3r joined the channel
ram0n joined the channel
Debnet joined the channel
eribol joined the channel
dmsimard joined the channel
bradfordli123 has quit
NomadJim_ joined the channel
ciaala has quit
BSLang has quit
hanetzer
https://ptpb.pw/65PU.png << this sort of layout, what term should I google to learn how to make something like this?
home/management/reports/accounting... each have a main section and subsections, which I think would all be called a 'view' in django
is that what that's called? I'm not a native web dev
firefox joined the channel
firefox
when i use git do i need to push all the migration files? theres tons of them
hanetzer
firefox: yeah. think they could makemigrations themselves but it strikes me as part of the codebase, as opposed to stuff like Makefile and Makefile.in when using autotools (which you supply a Makefile.am to)