Man I swear I've been having some weird problems with my Django unit tests ever since updating to Pycharm 4.0.
Do they work if you just go to the command line do a "manage.py test" ? Make sure you're in your virtualenv if using one, etc. when you do that. And does pycharm 4 change the test runner out from under you or anything like that? I've got one project which consistently passes 100% of the tests using the default test runner, but if I swap in django-nose it changes the way imports are handled somehow can creates a couple of circular dependencies which don't really exist, causing the tests to fail.
It ended up being an embarrassing issue... I didn't make the correct URL when doing my self.client.get() call.
Man I swear I've been having some weird problems with my Django unit tests ever since updating to Pycharm 4.0.
Do they work if you just go to the command line do a "manage.py test" ? Make sure you're in your virtualenv if using one, etc. when you do that. And does pycharm 4 change the test runner out from under you or anything like that? I've got one project which consistently passes 100% of the tests using the default test runner, but if I swap in django-nose it changes the way imports are handled somehow can creates a couple of circular dependencies which don't really exist, causing the tests to fail.
It ended up being an embarrassing issue... I didn't make the correct URL when doing my self.client.get() call.
Eh, test cases are still code. Just like any code, sometimes they have mistakes in them. Just wait until the day you have a mistake in your test case which makes it so that a bug in the code which should have been caught by that test instead passes.
Eh, test cases are still code. Just like any code, sometimes they have mistakes in them. Just wait until the day you have a mistake in your test case which makes it so that a bug in the code which should have been caught by that test instead passes.
Having insufficient test data for DB queries is a real classic here. I've had plenty of cases that returned the expected set of data... but for the wrong reasons because I had too little test data.
Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.
I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
Can I just say, !@#$% timezones and Daylight Savings? or maybe just !@#$% time.
That is all.
+2
Options
LuvTheMonkeyHigh Sierra SerenadeRegistered Userregular
Yup
Syncdb will not alter existing tables
syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation. Changes to model classes and database schemas often involve some form of ambiguity and, in those cases, Django would have to guess at the correct changes to make. There is a risk that critical data would be lost in the process.
If you have made changes to a model and wish to alter the database tables to match, use the sql command to display the new SQL structure and compare that to your existing table schema to work out the changes.
LuvTheMonkeyHigh Sierra SerenadeRegistered Userregular
Though reading more about it, it seems that Django 1.7 has a new migrations setup that can alter database tables. It's apparently heavily based on the South tool that the guy in bowen's link is talking about.
Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.
I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
There doesn't seem to be much to go wrong here. I've tried a bit to make it go wrong, but it just works short of having not saved the file, etc. Is there any chance PyCharm is doing voodoo and automatically making/running migrations behind your back, so when you go to do it manually it says no changes?
Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.
I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
There doesn't seem to be much to go wrong here. I've tried a bit to make it go wrong, but it just works short of having not saved the file, etc. Is there any chance PyCharm is doing voodoo and automatically making/running migrations behind your back, so when you go to do it manually it says no changes?
Nah with pgAdmin open I see the table but the columns don't exist.
0
Options
LuvTheMonkeyHigh Sierra SerenadeRegistered Userregular
I'm reminded of the "I'm the 56%" guy that said he was working 2 jobs and that's how he's able to make ends meet. As if that should be the default assumption and the guy who is disabled and can only work 20 hours a week is somehow bad because he can't.
As a disabled dude myself (paraplegic and currently working from a hospital bed at home) I totally agree with this. This had been a bad health year for me, and I was in an actual hospital a month or two back for a week and I kept working while in there. The nurses thought I was nuts, but I got docked pay earlier this year for not putting in a fill 40 each week for a pay period. I routinely work a 45-50 hours week, from bed, and I have to constantly make the case I'm a viable worker.
I'm reminded of the "I'm the 56%" guy that said he was working 2 jobs and that's how he's able to make ends meet. As if that should be the default assumption and the guy who is disabled and can only work 20 hours a week is somehow bad because he can't.
As a disabled dude myself (paraplegic and currently working from a hospital bed at home) I totally agree with this. This had been a bad health year for me, and I was in an actual hospital a month or two back for a week and I kept working while in there. The nurses thought I was nuts, but I got docked pay earlier this year for not putting in a fill 40 each week for a pay period. I routinely work a 45-50 hours week, from bed, and I have to constantly make the case I'm a viable worker.
I feel for you bro. G/f got removed from nursing school because she got put in the hospital and couldn't get a perfect on a math test. They hid it behind the vale of "well she has to pass out meds and can't make mistakes" all because of her having transplant complications.
Now they're reviewing her disability and something tells me this is going to be an uphill battle because as it stands she really can't afford to just pick up a part time job and pull in $300 a month at minimum wage, can't even afford to eat on that much.
This whole passion and work work work mindset needs to die, and everyone who perpetuates it is a bad person. IMO, 20 hour work weeks should be standard for the 50k household average people are pulling in now. If you're pulling in 100k @ 40 hours, good on you.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I'm doing my part! I really don't work extra hours. Even in the rare crunch period I don't go much above 40. I'm not even productive for all of the regular 40 hours, much less any extra
I'm doing my part! I really don't work extra hours. Even in the rare crunch period I don't go much above 40. I'm not even productive for all of the regular 40 hours, much less any extra
I'm pulling 45 at the moment to get a product finished by new years, but once I'm done that's it for me, shouldn't be another crunch for the next 10 years or so.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
The best way to keep ahead in the business world is to always keep learning. A new job? Learn. Skills you learn on the side are hardly, if ever, applicable. And when they are, you usually have to relearn them and apply it to business so you've got to fight a curve anyways. It's a use it or somewhat lose it system, similar to riding a bike. Once you got it, you got it, but hopping back on that bike after 10 years of not riding one is going to be a little strange at first.
I feel that in our line of work (coding) more than most others we have to be constantly learning too. I work in on-line media and that field is changing constantly - if I don't take time to learn and keep abreast of the technology I'm useless. Becaus of this, I feel employers should recognize that part of my job is that learning. I may not be coding, but that doesn't mean I'm not doing my job.
edit: sometimes the saved drafts bite you on the ass.
If you add up all the times I'm productive, it probably comes out to somewhere around 40 hours. But I'm not very productive on a normal schedule. I probably do most of my work between 2 and 6am.
makemigrations isn't doing anything for us. I might have to look into django-south.
Don't mix the two, it'll just cause weird confusion. Plus the built in migrations are a lot better and handle cases where South struggles, like custom user models (particularly in re-usable apps), much more cleanly because they were designed from day 1 with that sort of stuff in mind.
If makemigrations isn't seeing the changes to models then something isn't configured quite right and you'll be better off in the long run figuring out what is.
I think @LuvTheMonkey may be onto something there with the SO ideas he found. I didn't even consider those options... I usually forget that unamanaged models even exist and I've only done one 1.6 to 1.7 upgrade.
Hello fellow coders. I want to hand code a formula parser but I'm not sure how to check the token list for errors.
This is the order I want to do things in. The FormulaTree constructor accepts a token list, so that's what every function in there returns.
this.formula= new FormulaTree(MakePostFix(checkFormula(Tokenize(formula))));
I want my checkFormula to throw an exception if it finds something wrong. I guess I could jury-rig something ugly, but I'd like some better opinions. Also I'm feeling lonely.
Managed to modify a build script that generates our SD card images so that it no longer requires sudo/root. Originally required root because it was mounting images on loopback prior to modifying them, but e2fsprogs has a tool that allows you to add files to ext3 images without root access (provided you already have rw access to the images, of course).
I have what is probably the dumbest complaint about Atom... it refuses (at least, it did the last time I tried it) to show the list of open files over on the left of the window unless you've opened a folder. I want that darn thing there all the time. Last time I ran into this I even tried plugins to "fix" it, but nothing would work. </the whiniest of whines>
My biggest complaint about atom is that tab settings are not language specific. Most of the time I'm working in Python, so I use 4 space soft tabs to be consistent with everyone else. Just about anywhere else I'd like to use real tabs and when editing Makefiles I have to use hard tabs. I hate switching settings just so that I can edit a different type of file. If I had more free time I'd see how much effort it would be to make language specific tab settings.
I might have to check out Brackets. Maybe Light Table as well now that it seems to be getting more mature... last I heard about it it seemed to be a lot of big dreams, but not much really there yet.
@urahonky Take a look at http://www.ikea.com/us/en/catalog/products/00103102/ I have seen it compared to high end Aeron and Steelcase stuff on multiple occasions. I've never used one, but I think that's going to be my next at home office chair. If the comparisons are anything close to accurate, it'll be about the nicest chair you'll ever find in that price range.
My biggest complaint about atom is that tab settings are not language specific. Most of the time I'm working in Python, so I use 4 space soft tabs to be consistent with everyone else. Just about anywhere else I'd like to use real tabs and when editing Makefiles I have to use hard tabs. I hate switching settings just so that I can edit a different type of file. If I had more free time I'd see how much effort it would be to make language specific tab settings.
Posts
It ended up being an embarrassing issue... I didn't make the correct URL when doing my self.client.get() call.
Eh, test cases are still code. Just like any code, sometimes they have mistakes in them. Just wait until the day you have a mistake in your test case which makes it so that a bug in the code which should have been caught by that test instead passes.
Having insufficient test data for DB queries is a real classic here. I've had plenty of cases that returned the expected set of data... but for the wrong reasons because I had too little test data.
I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
try that
That is all.
I've only ever used south though, because I'm perpetually stuck on older versions
Nah with pgAdmin open I see the table but the columns don't exist.
@urahonky check this SO question - the first two answers may give you what you want.
As a disabled dude myself (paraplegic and currently working from a hospital bed at home) I totally agree with this. This had been a bad health year for me, and I was in an actual hospital a month or two back for a week and I kept working while in there. The nurses thought I was nuts, but I got docked pay earlier this year for not putting in a fill 40 each week for a pay period. I routinely work a 45-50 hours week, from bed, and I have to constantly make the case I'm a viable worker.
Oo\ Ironsizide
I feel for you bro. G/f got removed from nursing school because she got put in the hospital and couldn't get a perfect on a math test. They hid it behind the vale of "well she has to pass out meds and can't make mistakes" all because of her having transplant complications.
Now they're reviewing her disability and something tells me this is going to be an uphill battle because as it stands she really can't afford to just pick up a part time job and pull in $300 a month at minimum wage, can't even afford to eat on that much.
This whole passion and work work work mindset needs to die, and everyone who perpetuates it is a bad person. IMO, 20 hour work weeks should be standard for the 50k household average people are pulling in now. If you're pulling in 100k @ 40 hours, good on you.
I'm pulling 45 at the moment to get a product finished by new years, but once I'm done that's it for me, shouldn't be another crunch for the next 10 years or so.
I feel that in our line of work (coding) more than most others we have to be constantly learning too. I work in on-line media and that field is changing constantly - if I don't take time to learn and keep abreast of the technology I'm useless. Becaus of this, I feel employers should recognize that part of my job is that learning. I may not be coding, but that doesn't mean I'm not doing my job.
edit: sometimes the saved drafts bite you on the ass.
Oo\ Ironsizide
Was doing upwards of 60 leading up to the hospital go-live though, doing that is fine when there's a justified deadline and not just the norm.
Correct
I made a game, it has penguins in it. It's pay what you like on Gumroad.
Currently Ebaying Nothing at all but I might do in the future.
Don't mix the two, it'll just cause weird confusion. Plus the built in migrations are a lot better and handle cases where South struggles, like custom user models (particularly in re-usable apps), much more cleanly because they were designed from day 1 with that sort of stuff in mind.
If makemigrations isn't seeing the changes to models then something isn't configured quite right and you'll be better off in the long run figuring out what is.
I think @LuvTheMonkey may be onto something there with the SO ideas he found. I didn't even consider those options... I usually forget that unamanaged models even exist and I've only done one 1.6 to 1.7 upgrade.
I tried that and it did look like it created a migrations folder but when I ran the migrate command it didn't do anything. It's so odd.
Haven't tried it because I'm happy with Sublime, but it looks like a neat OS X-only option.
Did you check the managed setting for the model(s) in question? It'd be in the Meta class in its definition.
I would assume that it wasn't a problem since we literally just created this application, but I'll look on Monday!
This is the order I want to do things in. The FormulaTree constructor accepts a token list, so that's what every function in there returns.
I want my checkFormula to throw an exception if it finds something wrong. I guess I could jury-rig something ugly, but I'd like some better opinions. Also I'm feeling lonely.
Managed to modify a build script that generates our SD card images so that it no longer requires sudo/root. Originally required root because it was mounting images on loopback prior to modifying them, but e2fsprogs has a tool that allows you to add files to ext3 images without root access (provided you already have rw access to the images, of course).
https://atom.io/
If you want a free sublime, this is it.
I might have to check out Brackets. Maybe Light Table as well now that it seems to be getting more mature... last I heard about it it seemed to be a lot of big dreams, but not much really there yet.
Seems there's an EditorConfig plugin for Atom.