#django

/

      • Gen1us2k1
        idiots, I know, but what can I do?
      • nickjohnson
        Gen1us2k1: So provide them with reports that show them how many orders have been made
      • Gen1us2k1
        I can't quit.
      • nickjohnson: Fair enough. Maybe I will stick to your suggestion. Thanks for help :)
      • NBhosting joined the channel
      • rahulkmr has quit
      • zkanda has quit
      • NBhosting
        is a foreign key acting difrant in postgresql then sql
      • FunkyBob
        NBhosting: huh?
      • NBhosting
        in sql they appear for example as form item in my admin, in postgresql not
      • its shows in pgadmin, but not in the admin for
      • form.
      • FunkyBob
        erm... exactly what do you mean by "sql"?
      • NBhosting
        mysql
      • FunkyBob
        ah
      • raijin joined the channel
      • best to say "mysql" so we know you're talking about that toy
      • NBhosting
        k\
      • but did u get what i ment? with sql i get an list select field in admin
      • with postgresql i dont get that
      • FunkyBob
        foreign key is a field whose value must be a current value in the primary key column of a designated table
      • stop saying "sql" when you mean mysql!
      • NBhosting
        sorry habbit :D
      • rahulkmr joined the channel
      • FunkyBob
        fucking stupid habit
      • NBhosting
        :D
      • FunkyBob
        incredibly misleading
      • dev11 joined the channel
      • twoface read it as "rabbit"
      • NBhosting
        lol
      • FunkyBob
        where do you get this magic list?
      • dev11
        please link me some good beginners article for django, anything text/video is fine paid or free, thanks alot!
      • FunkyBob
        if you're talking about django's admin... it treats all fkeys the same
      • dev11: well, there's the tutorial in the official docs
      • dev11
        ok thanks
      • NBhosting
        dev11 lookup Mike Hibbert on yuoutube
      • dev11
        thanks !
      • kolaman joined the channel
      • NBhosting
        and check the google python videos
      • airtonix
        NBhosting: i wouldn't use mysql as the baseline to compare things with... best practice is to use a database that doesn't magically throw away data.
      • Nanor
        I'm trying to do search_fields = ['get_speakers'] where get_speakers is a function to get a comma separated string of speakers which is a many to many field. It tells me there's a field error and if I do search_fields = ['speakers'] I get the error "Related Field has invalid lookup: icontains"
      • NBhosting
        does mysql do that?
      • never noticed
      • airtonix
        yeah
      • fle has quit
      • NBhosting: i'll hunt down a link that explains it
      • NBhosting
        this is my first project ussing postgresql
      • dont notice much difrance yet
      • FunkyBob
        yet
      • airtonix
        NBhosting: the difference is in data integrity
      • muzik joined the channel
      • FunkyBob
      • NBhosting
        ah k, weird that i never notice data lose on mysql
      • will do
      • muzik
        Heyas!
      • airtonix
        but there are other differences. integrity is the first one you should care about though.
      • batisteo joined the channel
      • NBhosting: but the good thing is that most of your mysql sql knowledge will make transferring to postgresql easy
      • Narsilou joined the channel
      • muzik
        So im looking to insert some text into a pdf file and show it as a webpage or pdf file. Any suggestions on the easiest way? I have been adding template code to the pdf and converting it to html with pdf2htmlEX, but the results are very hit and miss with font and size :(
      • NBhosting
        yeah , its all going well so far
      • airtonix
        NBhosting: that video seems to be doing a good job of "tl;dr" it for me
      • Nanor
        I'm trying to do search_fields = ['get_speakers'] where get_speakers is a function to get a comma separated string of speakers which is a many to many field. It tells me there's a field error and if I do search_fields = ['speakers'] I get the error "Related Field has invalid lookup: icontains"
      • redShadow joined the channel
      • crunch-choco joined the channel
      • Any idea how I can search a many to many field?
      • medvind has quit
      • sokmar
        hmm, are there any builtin ways to detect that code is being run as part of a test? at middleware or view level for instance
      • FunkyBob
        Nanor: you search a field on the target model of the m2m
      • kezabelle
        sokmar: arguably, the code shouldn't care.
      • sokmar
        kezabelle: need to emulate an external service in my api for accessing it
      • FunkyBob
      • Nanor
        FunkyBob, I don't follow, could you elaborate
      • airtonix
        sokmar: then use something like mock
      • Gen1us2k1 has left the channel
      • NBhosting
        ah k , i did notice that in mysql
      • specialy on decimal fields
      • airtonix
        NBhosting: yeah it's pretty eye opening right?
      • NBhosting
        yeah
      • FunkyBob
        Nanor: you don't search the m2m itself, unless you're searching on pk values...
      • NBhosting
        its kinda silly but not a uge problem, ussualy
      • i always copy my tables when i do such thing
      • FunkyBob
        Nanor: you search on the fields on the related model
      • Nanor
        Ah
      • airtonix
        NBhosting: well if you're not dealing with money and your database schema is perfect first go out the door and never needs migrations
      • Nanor
        FunkyBob, that makes a lot of sense.. oops! thanks
      • NBhosting
        but the NULL thing is really silly
      • NULL should be null not 0
      • md4d has quit
      • radez_g0n3 is now known as radez
      • Nanor
        FunkyBob, So what would the syntax be? I'm doing this in the talkAdmin Admin Model. search_fields = ['speaker.name']?
      • FunkyBob
        speaker__name
      • Nanor
        FunkyBob, It tells me it can't resolve the keyword to a field
      • FunkyBob
        does it tell you what it can?
      • scristian joined the channel
      • NBhosting
      • Nanor
        FunkyBob, yes. It gives me all the fields in my talk class
      • _Qman joined the channel
      • FunkyBob, Perhaps I should put this on pastebin. I fear I may be omitting something
      • FunkyBob, would that help?
      • twoolie joined the channel
      • nickjohnson has left the channel
      • viktornagy joined the channel
      • FunkyBob
        Nanor: yes
      • Nanor
      • ragsagar joined the channel
      • stevarino joined the channel
      • FunkyBob
        good idea to follow conventions, like ProperCaps for class names
      • viktornagy
        hi, we've a test that fails when we run it together with another totally separate test method, but passes if we run our test only. The other method is in tests/models.py, this one is in tests/views.py. They have nothing in common at all. The view test fails, but there is a response object that seems to be OK, but our view code is never called. Did anyone have similar issues already? We're stuck with this for hours now!
      • FunkyBob
        so, the m2m field is called "speakers"... so ... speakers__name
      • tapia joined the channel
      • iulians joined the channel
      • tapia
        Hi. I need a log formatter to write the date as a timestamp
      • FunkyBob
        tapia: ok...?
      • tapia: can't figure it out from the Python logging docs?
      • rafaqueque joined the channel
      • iivvoo
        viktornagy, it happened to me when the test modified some global (cache) data that wasn't cleared between tests
      • tapia
        I've seen the datefmt uses the strftime format, and (afaik) it doesn't include a timestamp
      • iivvoo
        something similar may happen at the database level if your data isn't properly reset between tests
      • tapia
        at least, not the directives shown in http://docs.python.org/2/library/datetime.html#...
      • dash_ has quit
      • FunkyBob
      • it even has a formatTime method to override
      • iulians has left the channel
      • dash_ joined the channel
      • tapia
        FunkyBob, I know that doc
      • but in the django settings I've got this:
      • Bitcrusher01 has quit
      • 'formatters': {
      • 'standard': {
      • 'format' : "[%(asctime)s] %(message)s",
      • 'datefmt' : "%d/%m/%Y %H:%M:%S"
      • },
      • Nanor
        FunkyBob, THANKS!
      • tapia
        And I don't know how to set the 'datefmt' to print a timestamp
      • siovene joined the channel
      • or what should I override
      • viktornagy
        arrgh, wrong test user instance!
      • siovene
        Hi. How well does djanog's ORM search scale, before I need to give up and use a search engine like Apache Solr or Elastic Search?
      • FunkyBob
        tapia: don't paste in here... use dpaste like the topic says
      • tapia: you really should read the PYTHON docs on LOGGING
      • siovene: that really depends on your DBMS, not django
      • siovene
        FunkyBob, it's Postgres.
      • powellc joined the channel
      • FunkyBob
        siovene: well, there's some extensions to let Django use the Full Text Search
      • nyssa joined the channel
      • siovene
        FunkyBob, well luckily my searches are not about text, but about properties on models.
      • So only the occasional __icontains, but mostly just checking for numbers or whole strings.
      • nyssa_ joined the channel