now that my Project is registered in admin, I want to display the data to the user, ie ill make a includes snippet, like: {% block projects %} for x in projects: {{project.project_name}} etc
Klaipeda joined the channel
ycon_ has quit
seems like Id have to make an object that would hold each project if user had multiple ones, correct?
lolidunno has quit
vlt
tyriondwarf: I’d consider the registration in the admin app and the displaying of data to a user two completely different tasks.
lorddaedra
hi! I would like to run tests via `coverage run /usr/src/app/manage.py test`, I am looking for any way to add `-Wall` here to Python interpreter
how to do that?
tyriondwarf
vlt: fair enough. this is getting tricky. for each user, id need a list/object that contains all the projects theyve made, be able to run a for loop on that in the template
nazarewk joined the channel
ycon_ joined the channel
belmoussaoui_ is now known as belmoussaoui
v4ult joined the channel
fleetfox
lorddaedra: i'm not sure what -Wall does, perhaps you want -Wd
?
ycon__ joined the channel
ycon__ has quit
ycon__ joined the channel
vlt
tyriondwarf: Have you ever written a view that passes a context variable to a template to be rendered?
ycon_ has quit
PaulWay[w]
fleetfox: I think he wants all warnings. -Wall is a gcc flag for 'sort of mostly all of the warnings'
lorddaedra: do you want something like flake8, for PEP8 and other syntax compliance checks?
brunch joined the channel
tyriondwarf
vlt: dont think so, umm though for User I didnt need to. just called {{user.username}} {{user.email}} in the template.
for custom models though I need to
vlt
tyriondwarf: I’d recommend doinf the great offical tutorial.
*doing
jj7 joined the channel
tyriondwarf
ok writing first django app?
lorddaedra
yes.. I found way: I added "PYTHONWARNINGS: 'all'" to my docker-compose.yml
to environment: section
vlt
tyriondwarf: Yes, that one. Shouldn’t take you long.
lorddaedra
I tried to fix this 20 min, after I asked question in this channel I found answer after 30 seconds, magic :-)
vlt
lorddaedra: That’s called rubber duck programming ;-)
rajalokan has quit
beccamorgan joined the channel
jj7 has quit
beccamorgan has quit
rajalokan joined the channel
OtherAllan has quit
hailhydra
there used to be a really cool site that you could ask programming questions to in an HTML input form and a rubber duck would try to think of answers for you.
I used to direct Jr devs there all day at my old job.
PaulWay[w]
Heh
beccamorgan joined the channel
fleetfox
it's funny when someone walks to whiteboard starts drawing and talking. And before he has finished explaining even half of the problem. "NVM i got it."
FunkyBob
quack
jarshwah joined the channel
jj7 joined the channel
ycon_ joined the channel
hylje
sent ;)
hailhydra
FunkyBob is the Rubber Duck Champ.
beccamorgan has quit
PaulWay[w] has quit
jarshwah has quit
ycon_ has quit
Digitaltom joined the channel
netheranthem joined the channel
bobowen joined the channel
exaroth joined the channel
nix64bit
whats a good channel to bother people about vue-cli?
bobowen has quit
MrGrj
nix64bit: #vuejs ?
titodrew joined the channel
beccamorgan joined the channel
nix64bit
MrGrj: thanks
eshlox joined the channel
tyriondwarf
where do I even modify admin templates for my registered models
since I cant do it via python string, Ill go to the html
beccamorgan is now known as lodzhal
Lauxley joined the channel
vlt
tyriondwarf: My recommendation: You don’t.
tneva82 has quit
tyriondwarf
ok screw it.
lodzhal is now known as beccamorgan
Amnesia joined the channel
tyriondwarf has quit
Amnesia
question, I'm working on an app that uses Class based Views, and then the form is rendered in my template using form.as_table(). Unfortunately a boolean has become user adjustable, while this should not be the case
does anyone have a clue how to patch this?
jj7 has quit
Kaltenstein joined the channel
EyePulp joined the channel
nethop has quit
nix64bit
Amnesia: do you want to exclude that field from your form?
Amnesia
nix64bit: no, but I do want to make it read only (in my frontend)
currently it's a radio button
nix64bit
so you just want to show the setting?
Amnesia
correct
(I hope my question's clear enough:P)
nix64bit
there is a Field.disable in forms
I havent used it though
Amnesia
but I don't want to disable it as a whole, I just want to make it readonly:P
it's value should only be changed by the backend
nix64bit
he disabled boolean argument, when set to True, disables a form field using the disabled HTML attribute so that it won’t be editable by users. Even if a user tampers with the field’s value submitted to the server, it will be ignored in favor of the value from the form’s initial data.
As I said I hevent used it so rather let someone else try and help you
I would have rather have just had a label on the form and excluded the radio
adwin_ joined the channel
Amnesia is just looking for a quick fix:P
Amnesia
this codebase is hell, so I'm not bothered to refactor things cq. make things prettier:p
schinckel
Yeah, use Field.disabled, and just use {{ form.instance.<field_name> }} in the template.
Amnesia
instead of form.as_tabke ?
table*
Klaipeda has quit
adwin_ has quit
schinckel
I almost never use form.as_table/as_p
In fact, I think I'd probably use {{ form }} first.
Although, django-sniplates means I have pretty nice rendering.
Jaykay joined the channel
cebor has quit
Amnesia
hm, let's see what comes out of just {{ form }}..
cebor joined the channel
Jaykay
i have some importer that has a "dry run" option, and now i want to write a test that asserts that the database is not written (reads are allowed) when this option is enabled. is there a nice way to do that?
Amnesia
schinckel: is there some way to dir() the form object in the templatet?
Debnet joined the channel
moldy
Jaykay: afaik, not really
Jaykay
moldy: okay, thanks. maybe my google-fu didn't fail me after all :)
nazarewk has quit
Landverus has quit
hailhydra
nix64bit: did you have a Vue Question? I've been using it lately.
nix64bit
hailhydra: wondering about the best way to start learning it as a django template