d0ngz: For the first, you're not setting the slug, so don't know why you'd expect it to be there.
kuter joined the channel
Debnet joined the channel
bibhas
toothe, did you try that?
gcbirzan
d0ngz: For the second one, you don't have a view for details of a post, only a list one. You should also avoid building the URL by hand like that in get_absolute_url(): https://docs.djangoproject.com/en/1.7/ref/model...
jarshwah has quit
dodobas
yelloo
gcbirzan
benwilber: that's not true
cbsw has quit
Djenga joined the channel
benwilber: You _can_ use fixtures with the new migrations framework, you just have to declare dependencies correctly and monkey patch something (you should have mock already as a dependency)
benwilber: I see. Does that mean all my migrations will be run every time I run tests?
gcbirzan
hackvana: django-nose has a feature that let's you not destroy the DB if it already exists
erm
Genitrust has quit
I mean, it doesn't destroy it at the end of the tests :)
hackvana
I ended up with nearly 100 South migrations. Assuming I end up with the same number of django migrations, I'd be reluctant to have a system that insisted on running every migration every time.
gcbirzan
or at the beginning.
hackvana
gcbirzan: I see
gcbirzan
hackvana: btw, you'll get less migrations, but it'll be waaaaaaaaay slower
Genitrust joined the channel
hackvana
I still need to have the database start in a known state, which is why I'm using the fixture
gcbirzan
we have 129 migrations and they take 3 minutes and 10 seconds or so on my computer
hackvana: You can use that to load fixtures in migrations
hackvana
I have fixtures which take long than that each. I don't want to lose them (because I often refer back to them), and I don't want to collapse them.
gcbirzan
hackvana: What you do is, you run your south migrations, do a dumpdata, drop the DB, run the 1.7 migrations, then craete an empty one that just loads the data you just dumped
That's not possible.
yuwang has quit
You have to manually re-write them.
hackvana
I don't mean I need to re-run the South migrations
EstebanVelour joined the channel
I mean that for future Django migrations, I don't want to have to re-run them, or collapse them.
lorddaedra has quit
onyekaa joined the channel
gcbirzan: Red that bpaste, where do I put that.
lorddaedra joined the channel
swi joined the channel
gcbirzan
hackvana: You put that anywhere and then use it from a migrations loaddata(apps, 'myfoobar.json')
hackvana: Hm, I don't understand what you mean about future django migrations
hackvana
"create an empty one" <-- empty migration, or empty something else?
The migrations I write tomorrow and the day after.
Because what I'm showing there is running a test, and django is trying to load a fixture, but it's failing because the migration isn't run first.
silverfix joined the channel
gcbirzan
hackvana: What happens when you do this on the non-test DB?
hackvana
That's at odds with what you're saying, which is "migrations are run when you test" and "and it's not possible for a fixture to be run when you test". Not your exact words, but it's what I'm hearing
Tichodroma joined the channel
(disclaimer: I'm running this on a test machine with the db loaded with production data, so don't panic)
Tichodroma has left the channel
I expect it will pass, but it will also mess with the production data.
gcbirzan
hackvana: The problem seems to be related to flushing the DB after creating it.
hackvana: Might be related to some MySQL weirdness about DDL/transactions?
hackvana
Can you point me to a line number in my bpaste?
I'll try switching to sqliste
sqlite
gcbirzan
File "/home/mjd/git/env-1.7/lib/python2.7/site-packages/django/core/management/commands/flush.py", line 88, in handle_noargs
As it happens, we've overridden flush to not do anything, because it was deleting all the data in the DB before running the tests. Not sure if it works as intended now, I've given up on trying to explain why fixtures are useful to the django devs.
hackvana
And that RunSQL in the docs thing is just wrong. I want a db-independent way of encoding this data.
nlh has quit
gcbirzan
hackvana: also, another possibility is that you are actually not creating the table.
marxxin joined the channel
hackvana
That was my question: What is responsible for creating the table? Why is 0001_initial.py (which contains 26 CreateTables) not being called?
gcbirzan
What I'd try is to move the initial_data out of the way, then see if the table is created.
Foreword joined the channel
The flush should be run after all tables are created, but you might not have the model in there?
Foreword
Can somebody please tell me how to generate a choicefield in a for loop :/
gcbirzan
but, mind you, this is based on 1.7b3 or something when I last looked at this code
marxxin
hackvana - maybe django think that this migration is already applied?