#django

/

      • FunkyBob
        always
      • but I'm sure you're asking about specific issues?
      • rray
        and i try to use Value(now(), output_field=DateTimeField()) in a query, but it produces a syntactically incorrect postgresql query
      • FunkyBob
        erm
      • rray
        notably the query has '<a date string>'::timestamptz
      • FunkyBob
        you want to pass now() into the query?
      • rray
        yeah
      • FunkyBob
        why?
      • rray
        i was making something that was a bit db-agnostic
      • FunkyBob
        why not ask the DB for now?
      • rray
        and i found that passing in now() worked nicely
      • FunkyBob
        CURRENT_TIMESTAMP is quite DB agnostic
      • rray
        how do i do that?
      • FunkyBob
        I opened a ticket recently for adding that... and jarsh suppklied the code
      • JohnnyZ_1
        FunkyBob: https://dpaste.de/w90o doesn't make sense
      • FunkyBob
        JohnnyZ_1: when moving from 1.6 to 1.8... did you '--fake' apply any migrations?
      • Sklirg has quit
      • JohnnyZ_1
        FunkyBob: I faked the initial
      • FunkyBob
        just the initial? iirc contenttypes has 2 migrations
      • sturm joined the channel
      • rray
        how do i put current_timestamp in the query?
      • as i understand F expressions only work for the fields in the view
      • should i make a Func class to do it for me?
      • FunkyBob
        rray: well, I was suggesting you look up the ticket I mentioned, since it has the code
      • rray
        oh ok cool
      • FunkyBob
      • rray
        ty
      • this channel has been very helpful thanks guys
      • FunkyBob
        learning through teaching
      • connor_goodwolf has quit
      • JohnnyZ_1
        FunkyBob: yea only the initial which has the include contenttypes as a dependency. I didn't see it in my next migration. What should my next steps be?
      • Another thing: when I remove 'django.contrib.sites', and 'registration" out of my settings. contenttypes migrates successfully. no migrations to apply.
      • FunkyBob
        sorry, what? I meant did you fake any migrations on any of the other apps, like contenttpyes?
      • JohnnyZ_1
        No, I do not believe so
      • FunkyBob
        the most likely reason I can think of for the error you're seeing is that contetypes wasn't migrated properly
      • if you "showmigrations contenttypes" what does it show?
      • JohnnyZ_1
        [X] 0001_initial
      • [X] 0002_remove_content_type_name
      • Shobo has quit
      • FunkyBob
        can you check the actual DB table? see if it realyl has removed 'name' from that talbe?
      • connor_goodwolf joined the channel
      • JohnnyZ_1
        Hm. surprisingly it didn't
      • FunkyBob
        so, fake migrate contenttpyes to 0001.. then real migrate it to 0002
      • JohnnyZ_1
        ok done
      • name still exists
      • even after Applying contenttypes.0002_remove_content_type_name... OK
      • FunkyBob
        exactly what did you type?
      • JohnnyZ_1
        ./manage.py migrate contenttypes 0001 --fake
      • ./manage.py migrate contenttypes 0002
      • FunkyBob
        which dbms?
      • JohnnyZ_1
        mysql
      • FunkyBob
        bizarre
      • JohnnyZ_1
        Should I forcefully drop a column? Kind of annoying
      • Doesn't make much sense
      • FunkyBob
        well, you shouldn't need to... the migrations should take care of it
      • JohnnyZ_1
        actually
      • wait it did
      • FunkyBob
        but hey, it's mysql.. so...
      • JohnnyZ_1
        I apolgize
      • FunkyBob
        ah, ok
      • JohnnyZ_1
        I had to refresh it
      • dumb.
      • ok so thats done now
      • let me try to migrate with the registrtion
      • NomadJim has quit
      • NomadJim joined the channel
      • acangiani has quit
      • Hey Bob, not sure the best approach to go about this. So I did a manage.py migrate. Said (1050, "Table 'portal_user' already exists") so I went ahead and did manage.py migrate portal 0001 —fake - that went through then migrated to the next migration and it took. Now getting (1050, "Table 'django_admin_log' already exists")
      • nvm
      • fake migrated admin
      • FunkyBob: thanks for your all of your help. enjoy the rest of your weekend!
      • connor_goodwolf has quit
      • MarkusH
        JohnnyZ_1: python manage.py migrate --fake-initial (if you're on 1.8)
      • JohnnyZ_1
        Yea took care of it. thanks:)
      • connor_goodwolf joined the channel
      • garrypolley joined the channel
      • jMyles has quit
      • micahd joined the channel
      • garrypolley has quit
      • ElectroMetro joined the channel
      • veb joined the channel
      • ehmatthes has quit
      • fission6 has quit
      • ElectroMetro
        Cannot figure out why this is failing, and it is only sometimes. Traceback: https://dpaste.de/OTfv
      • bmn joined the channel
      • Recently downgraded from django 1.8 to 1.7
      • FunkyBob
        why downgrade?
      • ElectroMetro
        Wanted to use a module that doesn't support 1.8 yet
      • django-fixtureless if you are curious
      • FunkyBob
        make sure you've removed all the old .pyc files
      • what does that do?
      • craigbennett joined the channel
      • ElectroMetro
        its for fixtureless testing, generates test data automatically ;)
      • FunkyBob
        like factory-boy or model-mommy ?
      • ElectroMetro
        I guess so, couldn't remember the names of the other ones so I tried this one
      • synfinatic joined the channel
      • Alright, just deleted the .pyc's
      • Testing now
      • Im afraid it is the same thing
      • josuebrunel joined the channel
      • FunkyBob
        when you "downgraded'... did you pip uninstall django ; pip install django<1.8 ?
      • or did you just pip install django<1.8 ?
      • ElectroMetro
        changed my requirements.txt, then did --force-reinstall
      • FunkyBob
        pip uninstall django
      • ramsub08 joined the channel
      • ramsub07 has quit
      • ElectroMetro
        mk, testing again
      • same
      • FunkyBob
        exactly the same?
      • ElectroMetro
        yup
      • FunkyBob
        and this worked in 1.8?
      • ah, no, it won't
      • because ExpressionNode doesn't exist in 1.8 I think
      • ElectroMetro
        Yes, it worked perfect with no intermittent errors.
      • FunkyBob
        the reasl question is why is your django trying to import it
      • ElectroMetro
        Im not in any of my code.
      • capella-da-star has quit
      • fgau has quit
      • I am using celery
      • wonder if it is int here
      • FunkyBob
        well, what's odd is it appears to be django trying to import it
      • which is why I thought you might have mixed code from the upate/
      • it is in 1.7
      • NomadJim has quit
      • 1.8 does not
      • NomadJim joined the channel
      • so what do you have in your requirements to install 1.7.x?
      • ElectroMetro
        Django<1.8
      • 1.7.8 is installed
      • not sure if that is a beta or something
      • FunkyBob
        no, it 's not
      • ElectroMetro
        And the weird thing is sometimes the task works just fine.
      • craigbennett joined the channel
      • How can I help you help me? Not sure what information would be useful for tracking this down
      • might just switch back to 1.8
      • sturm has quit
      • shangxiao joined the channel
      • Walkman joined the channel
      • ramsub08 has left the channel
      • grumpi joined the channel
      • NomadJim has quit
      • NomadJim joined the channel
      • JohnnyZ_1 has quit
      • _t0mb0_ joined the channel
      • pyface joined the channel
      • dheerajchand joined the channel
      • garrypolley joined the channel
      • Can't call time.sleep() in django test? Got an async call that updates a profile, want to check the status after the update is for sure complete
      • davisagli joined the channel
      • Scratch that