#django

/

      • HowardwLo
        is there a way to check if a field has any duplicates?
      • the field doesn’t have unique = True
      • aliteralmind
        HowardwLo: Once? Or repeatedly and programatically?
      • Sonderblade joined the channel
      • johnnydiabetic has quit
      • HowardwLo
        aliteralmind: once :)
      • aliteralmind
        HowardwLo: How many rows in the table?
      • HowardwLo: Roughly
      • HowardwLo
        20k?
      • cottons has quit
      • aliteralmind
        HowardwLo: Woh :)
      • HowardwLo: What's your goal? To delete dup rows, or reset dup values to something else?
      • HowardwLo: Or...?
      • HowardwLo
        aliteralmind: purely informational
      • aliteralmind
        HowardwLo: You comfortable with sql and your specific installed database?
      • HowardwLo
        aliteralmind: not exactly, no :(
      • and its postgresql
      • totoybato joined the channel
      • i’ve done some row deletes
      • thats about it.
      • andrey_ joined the channel
      • garrypolley joined the channel
      • aliteralmind
        HowardwLo: Duplicate the table and fool around with the duplicate. To duplicate the table: CREATE TABLE films2 AS TABLE films; (http://www.postgresql.org/docs/9.0/static/sql-c... ). Then check out this answer: http://stackoverflow.com/questions/435964/how-d...
      • HowardwLo: That should be a good start, depending on exactly what kinds of duplicates (one column only, two columns together, ...) you're trying to find.
      • HowardwLo: Here's another good answer tailored to postgres: http://stackoverflow.com/a/14471928/2736496
      • emperorcezar joined the channel
      • HowardwLo
        aliteralmind: thanks! i’m only lookign for dupes within one table
      • er, column :)
      • and i just realized the number of rows that have something in that column is < 2k
      • garrypolley has quit
      • aliteralmind: does that change the advice? perhaps I can filter first by not blank :)
      • aliteralmind
        HowardwLo: (Actually I don't understand the PARTITION BY in the second answer I posted.) Just search for "postgres find duplicates" and you should get some helpful stuff. Also "postgres select". 2k vs 20k doesn't change much. Still "woh" :)
      • HowardwLo: I'm sorry I can't follow up, but I need to go. Best of luck. Hope it helps.
      • aliteralmind has quit
      • Sauvin joined the channel
      • jimfmunro joined the channel
      • cesar_bo joined the channel
      • HowardwLo has quit
      • andrey_ has quit
      • naro joined the channel
      • fuho has quit
      • jimfmunro has quit
      • lindii_ joined the channel
      • croepha joined the channel
      • dmitry_mikhaylov joined the channel
      • airtonix joined the channel
      • Asandari joined the channel
      • lindii_
        i have this code which works fine but it adds a new page parameter in the url everytime i hit next or prev https://dpaste.de/DQaU
      • airtonix_ has quit
      • ryanhiebert has quit
      • jmbrown412 joined the channel
      • ryanhiebert joined the channel
      • melinath joined the channel
      • jmbrown412
        Hi @all, I am looking for some good tutorials/books to learn django. I am coming from a wide background of experience, most recently with Rails. Any railscasts type sites for django?
      • CapnKernel
        jmbrown412: Hi there!
      • Have you gone through the Django tutorial?
      • jmbrown412
        Hey, good evening.
      • I don't know where that lives?
      • Got a link?
      • CapnKernel
        Go to the Django docs page, and at the top of the page, you'll see links to the 6 parts of the tutorial: https://docs.djangoproject.com/en/1.6/
      • jmbrown412
        Perfect, thanks!
      • CapnKernel
        It's pretty straight-forward, and if you get stuck or want to discuss anything, we're right here.
      • No problem. Enjoy!
      • jmbrown412
        Awesome first impression BTW.
      • CapnKernel
        Haha
      • croepha has quit
      • When you've finished the tutorial, there's a book many go on to: "Two Scoops of Django"
      • ryanhiebert has quit
      • timfernando has quit
      • garrypolley joined the channel
      • jmbrown412: If you're just starting out, what's your background?
      • jmbrown412
        Long time compiled language guy (C++, C#, Java) Recently been working w/ RoR. Do a lot of development in the payment industry for processing platforms.
      • Would classify myself as a "systems developer".
      • CapnKernel
        Sounds good.
      • With your background, I think you'll have no trouble at all. Like always though, every system just has its diferent ways of doing things.
      • jmbrown412
        I have a potential job opportunity and the stack is django. They are not particularly concerned that I don't have much experience with it. I think they know I can learn it and adapt.
      • I feel the same way. I really like Rails and I understand django to be pretty similar? Would you agree?
      • jmbrown412 is also a lover of IDEs so he downloaded pyCharm today.
      • garrypolley has quit
      • CapnKernel
        They're conceptually not that far apart. For example, the DRY principle is at work in both.
      • I heard (maybe I misheard) that RoR can be a bit hardware hungry
      • rohitvarkey joined the channel
      • jmbrown412
        I also heard that.
      • emperorcezar has quit
      • jax joined the channel
      • dmitry_mikhaylov has quit
      • CapnKernel
        I think there are lots of cool things happening in both the RoR and Django worlds
      • totoybato has quit
      • jmbrown412
        Is the amount of eggs as abundant as there are gems in RoR?
      • jax has quit
      • mstrcnvs joined the channel
      • Chunk2 has quit
      • mattmcc
        Is quantity actually a useful metric?
      • jmbrown412
        Sometimes.
      • But not always.
      • I could rephrase that question to something like..."Are there available eggs for the necessary things like JSON, http, files, csv handling, etc?"
      • mattmcc
        Well, that's all standard library stuff.
      • shashank_ joined the channel
      • CapnKernel
        jmbrown412: An interesting side-by-side comparison of RoR and Django
      • It points out areas of strength and weakness in both
      • melinath has quit
      • tac joined the channel
      • From that article, django seems a bit wordier, but as the article says, that's somewhat a reflection of the Python value of "explicit is better than implicit"
      • tac has quit
      • mattmcc
        Eww, they used auto_now.
      • Chunk2 joined the channel
      • ryanhiebert joined the channel
      • CapnKernel shrugs
      • tac joined the channel
      • jmbrown412
        Pretty in depth article.
      • I truly appreciate the information folks.
      • mattmcc
        Although it's already out of date now that 1.7 has native migrations..:)
      • CapnKernel
        Indeed. Not every work is greenfields though. South is going to be around for a long time.
      • jmbrown412: What mattmcc is talking about is how DB migration has been done in Django, up until the soon-to-be-released Django 1.7: There's a 3rd party package called South.
      • I think migrations are so important that for Django before 1.7, learning to use South should just be part of learning Django.
      • jmbrown412
        I was just reading about that. So 1.7 will have a built in piece for migrations?
      • johnny_b_ is now known as johnny_b
      • CapnKernel
        Yeah.
      • jmbrown412
        Nice.
      • Is the testing stuff in django or are there eggs for that as well?
      • CapnKernel
        TBH I haven't looked at it yet. I'm on 1.5. I know my app is broken in a few places on 1.6 and I haven't had the time to find and fix it.
      • mattmcc
        1.7 is almost the most significant release since 1.0.
      • CapnKernel
        jmbrown412: Testing's been in Django for a while, but 1.6 simplified how tests are discovered. Basically, name them right and they'll be found.
      • jmbrown412
        Cool.
      • mattmcc
        jmbrown412: Django's test framework is built on Python's own unittest package.
      • jmbrown412
        ah excellent
      • mattmcc
        Most of the stuff it adds are ORM-related.
      • CapnKernel
        Unit testing is pretty straight forward, and most everything you need is there.
      • mattmcc
        That said, you can also use Nose, Pytest, etc.
      • CapnKernel
        Web testing is something I'm not completely across, and people do use other tools
      • Yeah
      • mattmcc
        There's also support for integration with front-end tools such as Selenium.
      • jmbrown412
        Are there lots of people using PyCharm?
      • bibhas joined the channel
      • CapnKernel
        It's not unpopular.
      • mattmcc
        It's probably one of the more popular IDEs.
      • CapnKernel
        Lots of my friends swear by Sublime
      • mattmcc
        Although IDEs in general in Python.. eh.
      • Given its dynamic nature, IDEs don't necessarily have many advantages over a solid programming-oriented text editor.
      • CapnKernel
        I think one of the strengths is that you're not kinda locked into one way of writing code. Look at the hold Eclipse has on writing Java code
      • mattmcc
        It's not like Java where you'd almost be insane to write anything nontrivial without one.
      • CapnKernel
      • scarabx joined the channel
      • archen
        I'm a heavy PyCharm user. Autocompletion and the built-in static analysis are incomparable for Python IDEs as far as I've seen
      • jmbrown412
        It is pretty solid and their other tools are also rockin.
      • RubyMine rules.
      • archen
        I'm also a pretty big fan of IntelliJ's merge tools for git, and the issue tracking integration is pretty sweet