#django

/

      • moldy
        totte: you are passing 4 arguments to list(), but it only wants one.
      • totte: it's uncommon to create a list like that. do this instead: result_list = [a_count, b_count, ...]
      • aarose has quit
      • St4nd3l joined the channel
      • keimlink has quit
      • totte
        Ohh right, thanks... Not sure where I got that from...
      • lionmac has quit
      • uczekalla joined the channel
      • Mogget has quit
      • moldy
        totte: also, context_object_name = 'list' is not such a good idea. avoid using the names of builtins as variable names.
      • drapetomaniac joined the channel
      • DrSkyLizard has left the channel
      • keimlink joined the channel
      • totte
        Okey, thanks, I'm back on the track now! :)
      • areski joined the channel
      • stickperson has quit
      • Nizumzen joined the channel
      • mordonez has quit
      • keimlink has quit
      • mabus44 joined the channel
      • backthatzachup joined the channel
      • Frosh joined the channel
      • Ankhers has quit
      • backthatzachup has quit
      • tdy joined the channel
      • ghostmoth has quit
      • paddy-murphy joined the channel
      • drapetomaniac has quit
      • slmb has quit
      • bdmc
        Can somebody point me at what I need to be reading, as a brand new user of Django, to assemble a "simple" application to fit my transaction model from above?
      • stickperson joined the channel
      • totte
        Should the context_object_name and the value I return have the same name?
      • jargon has quit
      • naro has quit
      • St4nd3l has quit
      • Mogget joined the channel
      • DebianTUX
        bdmc: hey, django's websyte has a comprehensive and linear tutorial for begginers
      • bdmc: you can get almost everything there
      • bdmc
        I have gone through the polls tutorial, but, in my case, there are some big conceptual holes.
      • badet0s has quit
      • DebianTUX
        bdmc: you need to practice, you have just scrached the surface ;)
      • bdmc
        I agree.
      • DebianTUX
        *scratched
      • (bad english here)
      • bdmc
        DebianTUX: No problem. I got it.
      • DebianTUX
        bdmc: what didn't you got yet?
      • bdmc
        I agree. And I like what I have seen of Django. However, I have a specific need, and want to try and address it.
      • jezdez joined the channel
      • paddy-murphy has quit
      • The issue is that my project is a bit "unusual." Well, not really, but it is away from the basic tutorials.
      • DebianTUX
        a restfull api? that's not unusual at all
      • bdmc
        I have a REST API that I am trying to test. To do so, I see my projects like:
      • badet0s joined the channel
      • user->Django->REST API->External Service->REST API->Django->user
      • kolyaflash joined the channel
      • supergustaf is now known as gustaf_offline
      • sivy joined the channel
      • DebianTUX
        bdmc: you will need to beyond django, consuming a rest API in the pitonic way, i think.
      • bdmc
        More learning, I know. Where?
      • badet0s has quit
      • lionmac joined the channel
      • badet0s joined the channel
      • badet0s has quit
      • DebianTUX
        bdmc: do some googling so you can have more concrete questions and problems
      • badet0s joined the channel
      • badet0s has quit
      • jargon joined the channel
      • forcer
        bdmc: Just to make sure I got this right - you want to talk to a REST API from the server, not from the client?
      • sivy has quit
      • badet0s joined the channel
      • adiq has quit
      • dAnjou
        bdmc: what's that external service? chances are that they already have a python wrapper that you can use.
      • moldy
        totte: the name of something you return is not visible outside the function
      • forcer
        bdmc: For talking to generic REST APIs, do look at Requests, http://docs.python-requests.org/en/latest/
      • totte
        So I can just name it, like, whatever? The important thing is context_object_name which is what's used in the filters, right?
      • erik`
        and never use the standard library urllib :)
      • moldy
        totte: yes
      • bdmc
        Sorry, guys. I was off doing some searching of my own. Yes, this is a new Python REST API, developed to talk to this external service, and I am trying to develop a way to present a user interface.
      • to create a test or demo application to use the API
      • stickperson has quit
      • forcer
        bdmc: You are confusing me. Do you want Django to *provide* a REST API to some client, or *use* a REST API from some other provider?
      • victorhos has quit
      • (Or both :-))
      • bdmc
        to Use
      • forcer
        bdmc: Then see the recommendation for Requests above :-)
      • moldy
        totte: you should make a habit of using meaningful names and avoid clashes with the names of python builtins
      • bdmc
        OK, thanks. The REST API is a local library, if that makes a difference.
      • totte
        moldy: Yeah, this code has grown for over a year by now... Maybe I should rewrite it from scratch. There are a lot of unused imports and the like.
      • Thanks for the advice. :)
      • moldy
        totte: tools like flake8 and autopep8 may be helpful
      • timfernando joined the channel
      • totte
        moldy: Noted.
      • dAnjou
        bdmc: what do you think "REST" means?
      • bdmc: and what is a local library for you?
      • b_52globe has quit
      • forcer: what are non-generic REST APIs?
      • ;)
      • forcer
        dAnjou: Specific REST APIs that already have Python wrappers
      • bdmc
        Well, there is the formal definition. But to get into it a bit more, I have a Python library that is the endpoint of a REST transaction with an external server.
      • dAnjou
        forcer: that doesn't make much sense
      • bdmc
        In other words, calls to this library are then encapsulated in appropriate REST calls to the other server.
      • forcer
        dAnjou: Why not?
      • chachan has quit
      • atlasloewenherz joined the channel
      • dAnjou
        bdmc: then what's the problem again?
      • bdmc
        I can call this library, passing appropriate data and ....
      • forcer
        Now *that* is a good question :-D
      • bdmc
        The problem is that I am trying to build a Django "front-end" for this library.
      • dAnjou
        forcer: so when i write a piece of code that wraps an API it suddenly becomes specific as opposed to generic?
      • dustinfarris has quit
      • bdmc
        I have wondered whether this library fits into models.py, in place of the database, or somewhere else, or if I am completely off base.
      • forcer
        dAnjou: That's how I meant the "generic" in my statement, yes. I hope I did not confuse you too much. :-)
      • aarose joined the channel
      • bdmc: Somewhere else. It's just a normal Python library, put it where you would put any Python library.
      • dAnjou
        bdmc: you don't need models.py at all
      • bdmc
        OK, good. views?
      • badet0s has quit
      • I mean the calls to the library need to be exposed as views, mostly as displays, but some as input forms.
      • Or am I still needing to go back to school?
      • bibhas joined the channel
      • badet0s joined the channel
      • forcer
        bdmc: Yes. You write views that call your library.
      • bdmc
        Thank you. That was sort of what I was thinking some time ago, but dragged you all off down the garden path, not understanding what I was trying to do.
      • aarose has quit
      • Is the overall application log-in also a view? I know about the admin login, but want one for the users of the app, too.
      • forcer
        bdmc: Every request to the HTTP server causes a view in Django to be called.
      • bdmc
        That will probably be a version 2, but --- ok, got you.
      • forcer: I will look at the documentation on permissions in a little bit, once I get the basic system working.
      • Thank you all. I am sure that I will be back for more. B-)
      • janmuffino has quit
      • bearish has quit
      • nimomo joined the channel
      • rje has quit
      • thoas joined the channel
      • gcbirzan has quit
      • gcbirzan joined the channel
      • kenbolton has quit
      • kenbolton joined the channel
      • crazydiamond joined the channel
      • govg has quit
      • DebianTUX has quit
      • trustyhank joined the channel
      • timfernando has quit
      • keimlink joined the channel
      • jargon has quit
      • lionmac has quit
      • totte has quit
      • mysteryjeans joined the channel
      • onizo joined the channel
      • rje joined the channel