#django

/

      • cereal
        though, should be easy to do this w/o all this extra stuff and figure it out
      • FunkyBob
        aye
      • AndyRez has quit
      • anishshah2 has left the channel
      • matason joined the channel
      • AndyRez joined the channel
      • grafa joined the channel
      • AndyRez has quit
      • AndyRez_ joined the channel
      • gopar has quit
      • AndyRez joined the channel
      • AndyRez_ has quit
      • webus joined the channel
      • webus
        hello to all
      • how can i detect empty queryset before add aggregate function to this queryset ?
      • FunkyBob
        unless it's the none() queryset, you won't know it's empty without executing it
      • skylite joined the channel
      • Haudegen is now known as Guest8468
      • donoracceptor has quit
      • deanrock joined the channel
      • webus
        FunkyBob, i execute it and got a error: ProgrammingError at /task/hours/
      • syntax error at or near ")"
      • LINE 1: SELECT SUM("subquery"."hours_spent") FROM () subquery
      • Guest8468 is now known as Haudegen
      • i try to add aggregate function to queryset like this
      • queryset.aggregate(hours_spent_total=Sum('hours_spent'))
      • Haudegen joined the channel
      • and because after execute query set this queryset is null, aggragate functon can't execute
      • ojh has quit
      • AndyRez has quit
      • FunkyBob
        how about you dpaste the code + traceback?
      • Goopyo has quit
      • webus
      • FunkyBob
        and the code?
      • kaakku has quit
      • ohrstrom joined the channel
      • Goopyo joined the channel
      • Technodrome has quit
      • bee_keeper joined the channel
      • ohrstrom has quit
      • webus
      • code fail when execute block self.request.GET['look'] == 'today':
      • and this self.hours_spent_total_all = queryset.aggregate(
      • hours_spent_total=Sum('hours_spent'))['hours_spent_total']
      • xblitz has quit
      • geetar joined the channel
      • geetar has left the channel
      • mfcovington joined the channel
      • rhymes joined the channel
      • voidus has quit
      • MLM has quit
      • mfcovington has quit
      • Technodrome joined the channel
      • Evie_Hammond has quit
      • elyezer joined the channel
      • haobug joined the channel
      • haobug
        hi
      • elyezer has quit
      • i got a question: is it possible to set a field as multi-values, each value comes from foreign key to another table?
      • nozavroni
        FunkyBob: sorry I see you answered my question a while back and it's not exactly what I'm looking for. let me explain my problem and maybe you can better help me
      • I have a form that allows the user to add their rental history. I want them to be able to add as many previous rentals as they like. To do this, I want to create a template that I can render on the page every time the user clicks "add rental"...
      • exaroth joined the channel
      • FunkyBob
        nozavroni: sounds like you want a formset
      • nozavroni
        yes
      • Evie_Hammond joined the channel
      • thats exactly what I want
      • but I'm having trouble executing it
      • I want it to show only one form but have a button they can click to add additional forms as they need them
      • but in order to do this, I either have to pull the form into the page via ajax, or render additional forms and just hide them until the user clicks the button
      • but neither is proving to be particularly easy
      • because once the user clicks "submit", if there is an error, I have to have code to show the additional forms on subsequent renderings
      • and no matter what I've tried the code just gets too ugly and complex for such a simple problem
      • dodobas
        yelloo
      • Technodrome has quit
      • Sir_Narwhal has quit
      • FunkyBob
        dodo
      • nozavroni: you don't need ajax to pull the blank form... just look at how admin does it
      • but you will need JS
      • the formset provides you an empty form instance to use as a template
      • exaroth has quit
      • nozavroni
        the formset has rendered three empty forms on the page
      • FunkyBob
        so tell it not to
      • tell it you only want one
      • nozavroni
        I have.
      • but then how do I get additional ones?
      • after the page is already rendered?
      • FunkyBob
      • nozavroni
        this is where my previous question came from
      • FunkyBob
        as I said, look at how Admin does it
      • your previous question didn't appear to have _anything_ to do with forms or formsets
      • nozavroni
        lol I realize that I'm doing a poor job of asking my questions
      • softinio joined the channel
      • and you have been very helpful
      • bee_keeper
        Anyone feel like helping me understand why sdist won't build a package that includes a template folder? Feel I've tried all the 'include_package_data=True' type permatations and manifest options but to no avail..
      • FunkyBob
        aiui Admin renderes a hidden blank form to use as a template for adding new forms to the set on the fly
      • nozavroni
        to look at how admin does it, do I just look in django.contrib.admin?
      • FunkyBob
        nozavroni: well, you'd have to look at admin's JS
      • nozavroni
        ok I'll try that. thanks a bunch
      • FunkyBob
        bee_keeper: this is how I did it - https://github.com/funkybob/formulation/blob/ma...
      • saint-ron has quit
      • bee_keeper
        FunkyBob: I suppose that's one slightly different permatation i could try. I'll give it a go
      • softinio has quit
      • FunkyBob
        permutation
      • bee_keeper
        FunkyBob: I suspected that was the case..
      • codeitloadit has quit
      • Technodrome joined the channel
      • Goopyo has quit
      • Forgetful_Lion joined the channel
      • nkuttler
        hrm.. does somebody have an opinion on swampdragon? just looking through the docs, and it looks interesting
      • omnish joined the channel
      • kracekumar joined the channel
      • mfcovington joined the channel
      • kate_r has quit
      • kate_r_ joined the channel
      • nozavroni
        FunkyBob: are you referring to the popups in the admin?
      • in the admin, if I want to add a related model, there's a little plus sign that pops up a window to add that model
      • but I would prefer not to use popups
      • mfcovington has quit
      • I'm having a hard time figuring out where to look in the admin
      • melhiors joined the channel
      • Sonderblade has quit
      • FunkyBob
        no,I'm referring to inlines in admin
      • don't they show them in the tutorial any more?
      • bee_keeper
        FunkyBob: sdist still not including templates..the repo is here - https://github.com/bee-keeper/django-invitations - would you mind taking a look if you get chance please? I'm out of ideas..
      • nozavroni
        hmm maybe ill look
      • but as for that empty_form thing, it doesn't really provide much information about it. just that one paragraph. I can't figure out how to use it
      • ugh im lost
      • ewjoachim joined the channel
      • when I call empty_form() I get "'property' object is not callable"
      • ohrstrom joined the channel
      • tobiasthedev joined the channel
      • oh nevermind I got it to work... I think I can figure this out now
      • omnish has quit
      • omnish joined the channel
      • am I just supposed to replace __prefix__ with a number via javascript?
      • JayFK joined the channel
      • Tr0p1caL joined the channel
      • FunkyBob
        as I said.. look at what admin's JS does for inlines
      • or wait until nlh logs on
      • Left_Turn joined the channel
      • audioburn has quit
      • fflair12 has quit
      • JayFK
        is it possible to define a fallback language other than the default language? I have a site with a large german codebase and 100% EN translations. I'd like to fallback to EN if no translations are available for e.g. ES and not to DE.
      • nozavroni
        I've been poking around in the admin without much luck but ill keep trying
      • voidus joined the channel
      • voidus is now known as void
      • kate_r joined the channel
      • webus has quit
      • kate_r_ has quit
      • telex has quit