« first day (1348 days earlier)      last day (3604 days later) » 

12:04 AM
^ totally agree
I just recently learned django and found some 3rd party tutorials to follow that were a bit larger and more complex projects that helped out a lot
 
@FoamyGuy link(s)?
for instance, right off the bat I have multiple apps using Foreign Keys from models in other apps
importing them and using them is not too hard, but you have to write them all before syncing the db and what happens if you run syncdb on one before the others are built?
 
fair warning they are mostly aimed at older versions of django so you have to do a bit of tweaking on some, can't follow line for line.
I used the ones here lightbird.net/dbe2 mostly
that were meant for django 1.5, and I was learning 1.6
any snags I hit I was able to overcome relatively easily
 
12:27 AM
@FoamyGuy cool thx
 
12:49 AM
@Daи A bit outdated, but try github.com/nathanborror/django-basic-apps
 
@davidism thx!
 
 
1 hour later…
2:07 AM
I'm stumped on a datetime issue. I have a 'season' which is between may 1 and april 30. given a date, I must determine if it within the range for the current 'season' or not
 
2:23 AM
actually, I think there has to be better way of doing this altogether
 
2:56 AM
waits for his Skype call
good morning 4am
 
@JonClements morning
(cabbage)
 
cbg
how goes your morning?
ahh... been delayed by 20 mins, might as well have a shower then, brb
 
@JonClements well, but it's my evening, I'm preparing to go to bed but want to finish my models in a django app first
 
3:18 AM
have fun with that
 
http://stackoverflow.com/questions/24399626/looping-thru-pythons-os-walk-confusion
Any help with this simple question would be awesome.
 
@RickyWilson you are correct, you don't need that
 
Thank you @Daи
 
@RickyWilson I 'officially' answered, too
 
4:21 AM
I getting the following error with Django
alan@alan-desktop:~$ source django-project/bin/activate
(django-project)alan@alan-desktop:~$ cd storytime/
(django-project)alan@alan-desktop:~/storytime$ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/alan/django-project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/alan/django-project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
 
spell return properly?
 
5:19 AM
cbg folks!
 
5:33 AM
cbg @KDawG
 
hi, BrenBarn... or anyone else that can help with stackoverflow.com/questions/24400172/…
 
Hi
So, if you go into an interactive interpreter and do import hdl
then hdl.__file__
does that show the location where you expect to find your hdl package installed?
 
it'll show you the file that hd1 was imported from
 
moment
 
(that's not a question I'm asking to know, I was asking Satya to do that to get info about his problem)
 
5:38 AM
oh - sorry @BrenBarn - misunderstood the context
wow - nice to see you here actually - first time, or have I just missed you?
 
it shows me hdl/__init__.py
 
I've been here a few times just briefly when there was nothing going on
Just hdl? It should show you a full file path
 
....
 
Surprised someone with a good as a profile as yours hasn't turned up more :)
 
rassin frassin.... but, its the same code. i'm running this from where setup.py is located
i should try cd'ing out
 
5:40 AM
@Satya: Right, okay, that could be the problem
@JonClements: Does much go on here?
 
ok, after cd'ing out, it shows me a location inside the virtualenv (can't paste, the code is in another tower)
 
@BrenBarn lots... just not at 6:41am
 
heh
 
still get the same error after cd'ing out
 
@BrenBarn normally about 30 lurkers, and during GMT time about 15 active
 
5:42 AM
@Satya: Is it the location where you expect the thing to be installed to? Just trying to figure out if it's doing something weird in the install or there's another copy somewhere
 
and, btw, when i'm in the dir, the traceback shows it is using files from the installed egg in the virtualenv
 
hmmm
 
its the location i expect
 
hmmmm
 
i mean, it is the virtualenv/lib/python2.7/site-packages/hdl-dev-py2.7.egg/EGG-INFO/scripts/client‌​.py
which makes sense as far as i can tell
i've only been doing python packages for ~3 days
 
5:44 AM
hmmmm
so your thing is installed as an egg?
 
yes
python 2.7, does it matter?
 
what is currently in your init.py in the package?
Python 2.7 shouldn't matter for this
 
everyting commented out
don't spend much more time on this please, i am getting fed up because i feel like the answer is going to be something stupid (like i've got a typo somewhere)
 
heh
it's possible
 
and its way past time i slept
 
5:51 AM
can you look into that directory and see if the run_job.py file is actually there?
 
sure
SOURCES.txt does not list it
and its not in the directory where i would expect it
 
okay, so that seems like the problem
 
lib/python2.7/site-packages/hdl-dev-py2.7.egg/hdl/ that is
yes
and that dir contains some files which should not be there. grr.
(older files that were removed from the repo)
there are definite signs that this isn't what i think it is
dammit grrr argh augh
 
I'm looking at your setup.py
I've never been very good at these setuptools things
 
so i'm writing the code on my lappy
and rsyncing it to a dev container
and the dev container doesn't have the code, it has stuff that i removed days ago
(i run setup.py on the dev container)
 
5:56 AM
ah
well, it could be that the problem is somehow in your syncing/dev container setup
 
rassin frassin
guess what
the damn file wasn't named run_job.py it was named something else
AUGH
 
heh, okay
 
so. it works
 
great!
 
not sure what i should do, do i accept your answer? put in my own answer?
thanks for pointing me in the right direction, though
looking at the paths made me re-examine the filenames
 
6:00 AM
Either @BrenBarn can adapt his answer - they deserve it after spending this amount of time... but I've voted to close your question now.... or you just self-answer it later
 
Yeah, the question can just be closed/deleted
this basically falls under the "nonreproducible/typo" category
 
that's the close reason I used
no reason to delete it though
@Satya then when you're allowed, accept your own answer
 
I upvoted both the answers there, and self-answered too
 
@Satya good play
glad it works - always frustrating when something comes down to something so inane :)
 
If you like, @BrenBarn, you can adapt your answer and I can accept it. Doesn't seem fair to that other guy, though
see above, where i said (in different words) that it would be something inane.
i like 'inane'
 
6:03 AM
You can accept mine if it is what works with the right name, or just accept yours
 
I've upvoted @BrenBarn's because I've seen the effort they've gone through
 
Heh, thanks
 
@Satya I suggest just accepting your own answer
 
ok, will do @Jon
 
heh
 
6:04 AM
Are we on IRC all of a sudden? :)
 
its all irc
guess not, oh well
 
3 messages moved to Trash
 
so, just fyi, my code is now throwing a ConfigParser.NoSectionError. which is good, because i don't have a config file yet, and its gotten to a point where it has managed to import everything it needs
 
sounds promising
 
@Satya good luck with it
 
6:06 AM
you can do that? cool! (trash messages)
thanks, all
good night/morning/whatever
 
@BrenBarn so - any reason we don't see you around more? (being a very active and from your posts proficient Python user)
@Satya take care and good luck
 
@Satya pleasant dreams!
@JonClements: No particular reason, like I said I came a few times and saw not much of interest, so chat hasn't really been on my radar
 
Try 10am onwards :)
Lots of good users here
 
maybe I'll check it out some more
 
you're always welcome to do so
 
6:10 AM
Thanks
do you guys just chat about random stuff, or programming stuff, or particular things that come up on SO, or what?
 
all of the above
We're working on nidaba at the moment
But we talk randomly sometimes about random subjects... world domination and such :)
We update our wiki - don't know if you've seen sopython.com ?
 
nope, hadn't seen it
 
You know, Cabbage the language is lying in the dumps, waiting to be revived :)
 
@Volatility I've still got it in a git repo mate :)
 
6:14 AM
 
yeah, looking at the common questions, that is a useful list
the same questions come up so often
 
@BrenBarn we use those to decide what "we" consider canonical dupes
We're re-engineering the site a little bit
can't spell at 7:16am with 2 hours sleep apparently
 
I suppose bool is slower for the sole reason that it's a function call?
 
i'm usually a ruby programmer, but i'm working on this python package this week (i will not say this sprint grr)
so first they stuck all the code under configs....
 
6:18 AM
Outta curiosity: Will ya'll be using modules like NTLK for Nibada? @Jon
 
that is hard to search for
 
dealing spam is harder than I thought en.wikipedia.org/wiki/Bayesian_spam_filtering
 
@Satya it's not on github yet :)
think I've just bored @BrenBarn to death :(
 
@JonClements Is it ever likely to come to github?
 
heh, no I was looking through the gotchas etc.
 
6:26 AM
@BrenBarn with your experience, I'm sure you could add stuff there :)
 
Maybe so, I will have to thinj about it
it's hard to think of those kinds of things until they actually come up
 
It's a community project - burnt out at the start, but getting going again :)
We've also got that guy
well, bot
 
It's kinda hard to imagine this answer being given by a bot though ;)
12
A: Is it possible to have an alias for sys.stdout in python?

R.A.B.B.I.TNames in Python are just bindings. Therefore: f = sys.stdout Just binds the name f to the object that's also bound to sys.stdout... Note that since they're both the same object, any changes you make to f or sys.stdout at this point will affect both... So don't do f.close() as you normally wo...

 
@KDawG nope - I wrote it
it was just to get the bot to 20 rep
I didn't upvote or interact with it in anyway, so it's legit
 
I like its name though Robotic Artificial Being Built for Immediate Troubleshooting
 
6:31 AM
That'll sit here and after sopython has digest the info, post messages here regarding closures, dupe suggestions etc....
Help the RO's by cleaning up messages etc...
 
@JonClements Anyhow, assuming Nibada goes as planned then maybe you could contact SO directly and ask moderator privilege for Rabbit thus you needn't need gain rep by answering questions from rabbit's account
 
@KDawG doesn't work that way
no way in hell would I/SO want an automated system running amok in the chat system
one little bug, one little crash... what happens then
last time I built in redundancy, one didn't kill itself after all

Bot develops split personality...

Aug 20 '13 at 14:15, 2 minutes total – 23 messages, 5 users, 0 stars

Bookmarked Aug 20 '13 at 14:19 by Jon Clements

 
@Jon You'll be like the guy who introduced the heartbleed vulnerability ;)
 
Well, time for bed, so long
 
@BrenBarn take care - hope to see you again soon
@KDawG wouldn't take it quite that far
although - you do have some quite interesting images on your hard drive :)
 
6:48 AM
Hello. I'm pulling my hair out with relative imports for unittests. Does anyone know a way to make py3 unittests work without hacks like adding to the path? I would like it to be simple enough that anyone who gets the package can use just standard python -m unittest discover or something similar from the root directory. I have read many SO questions/answers on it and they all seem hacky or require non-standard methods of running the unit tests.
 
@kobejohn what's your directory setup?
 
sorry. not used to chat room syntax. just a minute.
 
Cbg all
 
oh thank the cabbage - @Ffisegydd STEWIE!!!!
 
6:50 AM
@Jon Briiiiiiiiiiiiiiian!
 
been up since 4 getting ready for a Skype video conference that never bloody happened
I'm going back to bed in a mo'
 
root
--package1
    --__init__.py
    --module1.py
--tests
    --__init__.py
    --test1.py
 
thanks for deleting that.
 
no worries - just taking up screen space :)
 
6:54 AM
I'm hoping in my frustration I have just missed the magical combination that works.
 
@kobejohn you're not using any frameworks on tops, or have stuff that registers itself as testable ?
 
I'm... not sure what you mean. Like TeamCity? I'm not using any continuous integration frameworks or anything like that.
 
or django or ....
pure Python?
 
no no packages. just python with a few imports like pillow
 
okay
the test names should be test_whatever for autodiscovery
 
6:58 AM
right. I'm sorry I was simplifying. they are.
 
brb... parcel
 
using from .. import package1 or from ..package1 import xyz give a bouquet of relative import errors caused mostly (I assume) by the __name__ issue.
 
That damn issue always catches me out
 
If it's worth anything, I have all my tests working with py2 implied relative imports (e.g. import package1)
I'm thinking of just saying that all the tests must be run with py2 and forget about supporting py3. It just bugs me that I can't find a clean way to do it.
 
yay... my new passport
brilliant - might even be able to visit Wales now @Ffisegydd :p
 
7:06 AM
What is your code for importing them at the moment?
 
oh wait... I could do that anyway :p
 
I'll contact the Motherland and schedule you for a random search at customs
 
seriously hopes no one took him seriously about that
 
just import package1. Somehow with discovery from the root, it works.
 
Brb need to head to work
 
7:09 AM
I've tried setting the -t (top level) to the root but it didn't seem to make a difference.
 
@kobejohn sorry buddy, I've gotta run too... got 2 hours sleep last night :(
 
I've a delta_string function with that I want to patch datetime.timedelta. I am trying

delta = (date.today() - self.dob)
delta.fuzzy = MethodType(delta_string, delta, datetime.timedelta)

It says `'datetime.timedelta' object has no attribute 'fuzzy'`
 
@NeelBasu put the fuzziness into a separate function and document it
 
Ya But I need to calll it from template
 
then register a function with whatever template engine you're using
 
7:12 AM
the default one that comes with django
How to register I don't know
 
@Jon Thanks for poking at the problem.
 
@NeelBasu fuzz it before hand and pass that?
@kobejohn sorry I wasn't much help
 
@JonClements No there may be other functions that will need raw timedelta
 
That way you can still pass the "real" timedelta to the context, but render it differently in the template engine
 
not properly getting the file layout
created a templatetags directory inside app directory and placed init.py
where will I place the template.Library ?
 
7:20 AM
The app should contain a templatetags directory, at the same level as models.py, views.py, etc. If this doesn’t already exist, create it - don’t forget the init.py file to ensure the directory is treated as a Python package. After adding this module, you will need to restart your server before you can use the tags or filters in templates.
Have you followed all of those instructions?
 
Ya That done but where would I write the lines to register ?
 
errr
have you created a templatetags directory?
 
yes and placed an __ init __ .py
 
okay, have you created a file in it?
 
an placed an apppname_extras.py
 
7:23 AM
okay
 
yes would I place the registering code in appname_extras.py ?
 
I give up. I installed nose and it all runs perfectly with relative imports. tests_require = ['nose'] !!
 
from django import template
from patients.utils import *

register = template.Library()

register.filter('delta_string', delta_string)
Is this enough ?
delta_string comes from patients.utils
Worked Thanks
Got it
 
@NeelBasu probably what you're best doing is putting a property on the model
That way you can even query the model and use it in the template
However, not fully aware of how your system is designed, so... I'll step back and let you get on with it
@NeelBasu just check out docs.djangoproject.com/en/dev/ref/templates/builtins/#timesince before you're re-inventing something
 
7:41 AM
I am in learning phase. probabbly Its the 4th day with django
Now checking south
 
For 4 days I'd say you're doing remarkably well
 
CBG!!!11
 
7:57 AM
omg @IanClark
good/evil today?
always a two knight problem without the other knight :)
 
cbg all. In the office now.
@Jon haven't you gone to bed yet?
 
errr
oh, right, that sleep thingy
I might have forgotten about that one
you're not still pissed off about #1?
 
8:17 AM
No of course not. And I wasn't pissed off in the first place. It's difficult to convey humour over the internets :P
I understand that you're going to be busier etc I was just being overly dramatic for comedic effect.
 
understood :)
 
We're all busy from time to time. To be honest I've been slowly stopping talking as much during the day recently anyway as I'm busier with PhD things.
 
Have you looked at your talk traffic :)
 
:P yeah but that's mainly dominated by the past, recently I'm slowing down.
Still lurking though.
Always lurking...
 
/me peers outside his castle window
/me recinds the drawbridge
 
8:21 AM
This reminds me of a great moment in The Fifth Elephant.
When one of Vetinari's Dark Clerk's is in one of the watchtowers and he hears a knock
And he's afraid werewolves will try to get in
So he goes down very quietly with his crossbow watching the outside.
then he realises that you can knock from the inside of a door too.
 
lol
Vetinari was one of my favourite characters
 
But yeah moral of the story is there's no point pulling up the drawbridge when I'M BEHIND YOU FOOL!
 
and in the time it took to say that, I'm behind you with a shotgun to the head
do you feel lucky baby, do ya? :)
which book was it that Vetinari got locked in his own tower
 
Guards, Guards!
The first Guards book
 
ahhh.... so he could have left anytime
because the lock was on the inside?
 
8:31 AM
Yeah yeah
 
I liked Vimes also
 
Vimes is a boss.
 
I'm more a Vetinari figure myself :)
 
@jon good Ian!
Tired Ian
 
@Ian how's it going with the glasses comp?
 
8:45 AM
@JonClements yeh good thanks, other than a DOS attack yest!
 
yup - that sounds fun
 
:D
@JonClements are you still hideously busy? :)
 
always busy
Stewie reminded me I didn't get any sleep - what's up?
 

« first day (1348 days earlier)      last day (3604 days later) »