tbaxter: example : open(BASE_DIR + '.../.../.../progress.txt', 'w')
tbaxter
what the everloving hell is that
persina
tbaxter: like I said, any io operations
joshuajonah
persina, how often are you opening local files in your project?
eefvx joined the channel
persina
joshuajonah: often. I'm logging stuff, reading files, writting files, etc.
tbaxter
I smell a mess.
`nik`
here is my form with my MultiValueField - http://dpaste.com/20NEB1Z - it's working, but the labels I'm specifying with IntegerField aren't showing up. if anyone sees any obvious problems with the code let me know.
joshuajonah
lol
v0lksman
why doesn't my mock override the views calls to get_filesize (only one I'm testing right now) https://dpaste.de/v1P6
I'm basically expecting that size = '13k' in the view
tbaxter: yea, i have a solution. I'll just add the paths to settings.py so i only have to open(PROGRESS_FILE)
iGeni
did something change in name_map = self._meta._name_map / name_map = self._meta.init_name_map() in 1.8.5
grafa has quit
tbaxter
persina: because first, Django handles most IO operations for you, if you let it. ANd logging, too. Second, the way you’re doing that is horribly fragile and will never survive any filesystem change. Third, the existince of progress.txt looks like a wild perversion o the templating system.
joshuajonah
persina: That sounds more sane
tbaxter
agreed
iGeni
it says 'Options' object has no attribute 'init_name_map'
joshuajonah
Or a wild perversion of an anyalytics system
\/auditing
Melamo joined the channel
iGeni: Well, go into the django codebase and see if that exists.
It is the best documentationa fter all.
persina
tbaxter: I can just change the paths in settings.py in the case of a file system change. progress.txt is not a template, it is created and then displayed to the client
joshuajonah
`nik`: I'm trying to figure this out for you. Just looking at django's code base to see where it creates the html for this field.
persina
i guess i could make it a template...
joshuajonah
persina: For what purpose is this written tot he file ssytem and shown to the user?
persina
joshuajonah: its written, saved in a /progress directory and then shown to the user upon redirect
sheshkovsky has quit
joshuajonah
iGeni: You still haven't sent an actual traceback, you just copy and pasted the debug page.
persina: WHY?
Are you saving cookie recepies? Is this a hit list of vegans? whay?
persina
joshuajonah: so the user can view the progress file which explains what happened in the computation
joshuajonah: it's also queried via ajax during the computation
joshuajonah
Whatever, either way, this sounds like a TextField in the database.
persina
joshuajonah: no access to a database
joshuajonah smashes face on keyboard
brat197 joined the channel
youngbaks joined the channel
joshuajonah
So you're using the filesystem as a half ass database.
I guess there's merit to that
persina
joshuajonah: and anyways, i don't need a whole database for a tmp file that gets rewritten every time.
joshuajonah
Except it's about 5345345343534 times faster than file i/o
Itkovian joined the channel
If it's always rewritten, i would even use a cache
persina
joshuajonah: the txt file has max 30 lines, efficiency isn't really a problem.
v0lksman
yay
persina
joshuajonah: no point in caching 30 lines of txt..
joshuajonah goes outside to smoke furiously.
garrypolley joined the channel
joshuajonah: and the majority of the file is different upon each run
tbaxter
shit, you can do a progress bar with nothing more than an integer and some css
persina
tbaxter: its a more detailed progress bar :P
rpkilby joined the channel
joshuajonah
Why do you not have a database? is this some sort of embedded system?
anth0ny joined the channel
Poulet joined the channel
bender314 has quit
transit joined the channel
SteenJobs has quit
mehola joined the channel
flobin has quit
byoungb has quit
Melamo has quit
mehola has quit
krawchyk has quit
transit has quit
ikerDePount joined the channel
cocteau joined the channel
edgabaldi has quit
Nizumzen has quit
transit joined the channel
rpkilby has quit
APXtvlKDVI joined the channel
Coldblackice joined the channel
APXtvlKDVI
Can a template have multiple {% extends %} tags?
mburke05 has quit
joshuajonah
APXtvlKDVI: no, how would you even expectthat to work?
v0lksman
APXtvlKDVI: no but you can use {% includes %}
tbaxter
no. it sounds like you’re not using blocks well.
solidvance has quit
v0lksman
or that :)
APXtvlKDVI
Oh yeah, I can see why that wouldn't work. I'm trying to have a "sub-template" that fits into several templates' {% block %}{% endblock %} tags, but I'm not sure how to do that.
brat197 has quit
Like the inverse of the typical case where you have a base template and several child templates.
tbaxter
sub template usually means poor inheritance. You CAN use include, but usually shouldn’t.
nirakara has quit
but sometimes, include is the thing. it’s there for a reason.
I’m a big fan of inclusion tags, too
v0lksman
APXtvlKDVI: sounds like you want your app to extend base_app.html which in turn extends base.html
tbaxter
that’s a super common pattern I use all the time.
msg555 has quit
APXtvlKDVI
Well, what I'm trying to do is...I have several templates that have a form, and instead of writing out the same form crap with {% if %} and {% for %} tags and whatnot, I wanted to replace them all with {% block %} tags and have a single forms.html or something that gets plugged into those templates.
v0lksman
include
APXtvlKDVI
Oh
I didn't know that was a thing.
keimlink has quit
v0lksman
{% include 'form.html' %} something along that line
APXtvlKDVI
Thanks!
tbaxter
actually, I’m thinking inclusion tag, jsut so you can get the form class and insert it into the current context.
CrypticSquared has quit
v0lksman
however you may need to use an inclusion tag if you need some logic around it