#django

/

      • felixsamora joined the channel
      • Frostig
        In Mavericks you finally don't need Xcode for Command line tools
      • josePhoenix
        Frostig: perhaps not a solution to your particular problem, but I've found that building python this way ensures all the expected headers are where they should be, etc
      • dangayle joined the channel
      • Frostig
        josePhoenix: Alright. I may try it, or I just run my projects from my virtual machine
      • Ariel_Calzada has quit
      • like I do with all my php projects anyway :P
      • dangayle
        I'm trying to do a self.stdout.write("{}".format(entry['title'])) within a management command, but I'm getting a `UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 25: ordinal not in range(128)` error
      • Dev0n
        Frostig, you ever tried oursql instead of MySQL-python?
      • just a better weapper overall imo
      • wrapper*
      • Frostig
        Dev0n: does that wrapper work for mysql? *dumb-question*
      • josePhoenix
        Frostig: whatever works! Managing complexity with building/installation is a pain how-ever you try to do it
      • Dev0n
        Frostig, it's a wrapper of libmysqlclient, so yea :)
      • Frostig
        josePhoenix: Yeah, I run my project through intellij for development purposes, so it seems easier to not only use the command line. But it's better to use it for learning puposes anyway.
      • Dev0n
      • Frostig
        Dev0n: Guess it's available from pip?
      • Dev0n
        indeed it is
      • tylergoza has quit
      • pip install oursql django-oursql
      • Nelluk joined the channel
      • Leeds joined the channel
      • Frostig
        Do you need cython for django-oursql? And I get some other compile warnings now :/
      • Screw this, I'll just it from my vm
      • Dev0n
        you don't frodopwns
      • Frosh,
      • omg
      • Frostig,
      • weird, it's not in pypy anymore
      • Frostig
        I get "ould not find any downloads that satisfy the requirement django-oursql"
      • nielsbusch has quit
      • Dev0n
        you can always pip install git+git://github.com/dcramer/django-oursql@master Frostig
      • schinckel
        You'll need #egg=django-oursql, right?
      • Frostig
        Dev0n: Okay, cool. I didn't know that was possible, but I still get errors on the main wrapper
      • Dev0n
        erm, @master should work schinckel
      • godfather has quit
      • Frostig
        But nvm, need to go to bed so I can work tomorrow :) gn and thanks for the help!
      • kenbolton joined the channel
      • Dev0n
        np, nn
      • Frostig has quit
      • alternatively, you could check out postgres :P
      • Fush joined the channel
      • dirn has quit
      • dirn joined the channel
      • Gentle has quit
      • cl0secall joined the channel
      • Gentle joined the channel
      • cl0secall
        hello
      • zenoamaro joined the channel
      • felixsamora has quit
      • djm- has quit
      • jderosa has quit
      • I'm having a (stupid) problem with staticfiles and could use some guidance where I should look next.
      • Z_A_M joined the channel
      • dirn_ joined the channel
      • the templates in this app use "{{ STATIC_URL }}" but that value is empty unless DEBUG=True
      • dirn has quit
      • dman777_alter joined the channel
      • garnertb joined the channel
      • dman777_alter
        when writing class based views, how do I new which class to use? For instance, there is Views and detailViews
      • jderosa joined the channel
      • bulkan has left the channel
      • ticketbot has quit
      • ticketbot joined the channel
      • felixsamora joined the channel
      • nkuttler
        dman777_alter: well, View is generic and DetailView is to display a single object
      • dman777_alter
        nkuttler: because of httpreqponse(), I always thought as bot returning a single object
      • jarshwah has quit
      • *httpresponse
      • jarshwah joined the channel
      • JSLint joined the channel
      • unbracketed joined the channel
      • unbracketed has quit
      • sentinal8473 has quit
      • hhatch has quit
      • munichlinux has quit
      • unbracketed joined the channel
      • nkuttler
        dman777_alter: you should probably start at https://docs.djangoproject.com/en/1.5/ref/class...
      • ehmatthes has quit
      • __love__
        oh formfield_for_foreignkey
      • you make evil so easy
      • nkuttler
      • Forgetful_Lion has quit
      • Z_A_M has quit
      • aberrant has quit
      • merica has quit
      • jarshwah has quit
      • eZpl0it joined the channel
      • dman777_alter
        nkuttler: ya, been studying that but i guess i'm kind of slow learning. for instance, with detailview "While this view is executing, self.object will contain the object that the view is operating upon.". what do they mean by self.object? everything is a object in python and each class will have it's own objects, etc.
      • EvilDMP joined the channel
      • nkuttler
        dman777_alter: self.object is a property of self and contains the object the orm found, usually based on pk or slug
      • EvilDMP has quit
      • frodopwns has quit
      • dman777_alter: so request -> orm -> returns object -> in self.object where self is an instance of DetailView
      • dman777_alter
        nkuttler: ah...i thought slug was a random name...not a reservered keyword. so, if i wanted to send a parameter from the url dispatcher to the class view...would i used detailview or is that only for orm objects?
      • hetii has quit
      • nkuttler
        dman777_alter: a DetailView is used to fetch an orm object
      • dman777_alter
        nkuttler: ok, thanks!
      • Fuyou
        slug is not a keyword
      • nkuttler
        DetailView, ListView, CreateView all work on orm objects
      • oh right, you can call your SlugField however you like
      • lduros has quit
      • epicowl joined the channel
      • canibanoglu has quit
      • culturelabs joined the channel
      • nicholasserra joined the channel
      • arteme joined the channel
      • hwrd|work joined the channel
      • aeikenbe_ has quit
      • ehmatthes joined the channel
      • chrisstreeter has quit
      • chrisstreeter joined the channel
      • arteme
        hi! I have an interesting problem -- I have many installations of the same project on different machines and one of them is exhibiting a problem when an add view for a ModelAdmin of a particular in the admin site does not show any inlines
      • dirn_ has quit
      • patrick91 joined the channel
      • the problem is that it still requires the management form instance on post
      • garnertb has quit
      • dirn joined the channel
      • garrypolley joined the channel
      • dirn has quit
      • kenbolton has quit
      • dirn joined the channel
      • sari11 joined the channel
      • sari11
        How would I do something like this from within python? <img src="{% static "project/images/logos/logo_draft1.png" %}"/>
      • stilgar has quit
      • epicowl has quit
      • Z_A_M joined the channel
      • FunkyBob
        sari11: have a look at hwo the static tag works... it's quite simple
      • schinckel
        sari11: You'll do something like that from within your template, not within python.
      • breno has quit
      • sari11: Except, the stuff in the string will probably not include your <project-name>
      • jjmalina has quit
      • sari11: But yeah, read the documentation about it.
      • sari11
        got it :) thanks a ton link = "<img src=\"/static/project/images/flags/flags/flat/16/" + filename + "\">";return mark_safe(link)
      • mattmcc
        Eh, you probably don't want to hardcode your static URL.
      • schinckel
        sari11: Yeah, that's probably not a good idea.
      • mattmcc
        See staticfiles.finders.find
      • sari11
        ah :\ i can't seem to get any static stuff to work unless it's in appname/static/appname/
      • nicholasserra has quit
      • mattmcc
        Well, that's the only place they're looked for by default.
      • You can also add directories to STATICFILES_DIRS.
      • enemykite has quit
      • cl0secall
        I figured my own problem out: the app set ALLOWED_HOSTS and it was wrong
      • sari11
        mattmcc: this is just testing/development, still bad to do so? will have to change everything on deployment machine anyhow
      • cl0secall has left the channel
      • mattmcc
        sari11: You'd be amazed how often "It's just for testing" becomes production code before anyone notices in time to fix it.
      • breno joined the channel
      • sari11
        ahh
      • eedeep
        mornings... i'm calling my_form.save(commit=False) where form.is_valid() has already been called and is True but for some reason the data in my_form.cleaned_data isn't getting set on the new model instance which comes back from my_form.save(commit=False)
      • what am I missing?