[gsoc-dev] [GWM Tests] Need help
Chance Zibolski
chance at osuosl.org
Thu Aug 29 19:59:27 UTC 2013
Firstly great progress.
Secondly, there are definitely some optimizations that can be done. You
probably only need 1 view for your JSON, and DB Query per cluster.
You should read the following pieces of documentation from Django:
https://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects
https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_related
Using related objects, you can reduce the number of queries you do to 1.
You can use something like this:
https://gist.github.com/ecnahc515/756d83f8742e8628ae88
>From there you should be able to return all the JSON in a single JSON
response, and you can change your Ajax code to only do one $.get() request.
I'll keep looking and test out your changes, and test your tests :).
Lance and Ken might have more suggestions on what the visualization could
use.
On Thu, Aug 29, 2013 at 11:54 AM, pranjal mittal
<mittal.pranjal at gmail.com>wrote:
> Oh, is that because the tearDown is not exhaustive? (as the setUp)
>
> btw.. I just wrote my first django tests (for ganetiviz) [1]. :)
> Via the test case I verified that the JSON output via ganetiviz is in an
> expected format.
> I am thinking on the other aspects I could test.
>
> I am also curious to know, what else I must improve, to make feature/13569
> suitable to be merged into develop?
> Any possible optimizations you suggest, that could improve speed with
> huge datasets?
>
> [1]
> https://github.com/pramttl/ganeti_webmgr/blob/feature/13569/ganeti_web/ganetiviz/tests/views.py
>
>
> Cheers,
> - Pranjal
>
>
> On Thu, Aug 29, 2013 at 11:41 PM, Chance Zibolski <chance at osuosl.org>wrote:
>
>> Make sure you set it back before you start runserver or you'll get some
>> wonky testmodel users in your users db table. Its a bad hack we need to
>> still fix :)
>>
>>
>> On Thu, Aug 29, 2013 at 1:11 AM, pranjal mittal <mittal.pranjal at gmail.com
>> > wrote:
>>
>>> Cool! It works now. :)
>>>
>>>
>>> On Thu, Aug 29, 2013 at 1:31 PM, Piotr Banaszkiewicz <
>>> piotr at banaszkiewicz.org> wrote:
>>>
>>>> Set
>>>>
>>>> TESTING = True
>>>>
>>>> In your settings file and you should be good to go.
>>>>
>>>> *From: *pranjal mittal
>>>> *Sent: *czwartek, 29 sierpnia 2013 09:59
>>>> *To: *gsoc-dev at lists.osuosl.org
>>>> *Subject: *[gsoc-dev] [GWM Tests] Need help
>>>>
>>>> Hello Everyone,
>>>>
>>>> I was trying to write some tests.
>>>> I noticed that this line is causing problems when I try to run GWM
>>>> tests.
>>>>
>>>> *from object_permissions import get_user_perms*
>>>>
>>>> It gives an import error saying-
>>>> *ImportError: cannot import name TestModel*
>>>>
>>>>
>>>> Do I need to update the object_permissions app or is there some bug in
>>>> here?
>>>>
>>>> Here is the complete traceback of the error:
>>>> http://pastebin.osuosl.org/3163/
>>>>
>>>>
>>>>
>>>> Thanking You,
>>>> - Pranjal
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Pranjal Mittal
>>>> B.Tech. 2014
>>>> Indian Institute of Technology,BHU
>>>> Varanasi, U.P,
>>>> India
>>>>
>>>> Github <http://github.com/pramttl> | LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
>>>> Blog <http://pranjalmittal.in>
>>>>
>>>>
>>>> _______________________________________________
>>>> gsoc-dev mailing list
>>>> gsoc-dev at lists.osuosl.org
>>>> http://lists.osuosl.org/mailman/listinfo/gsoc-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Pranjal Mittal
>>> B.Tech. 2014
>>> Indian Institute of Technology,BHU
>>> Varanasi, U.P,
>>> India
>>>
>>> Github <http://github.com/pramttl> | LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
>>> Blog <http://pranjalmittal.in>
>>>
>>> _______________________________________________
>>> gsoc-dev mailing list
>>> gsoc-dev at lists.osuosl.org
>>> http://lists.osuosl.org/mailman/listinfo/gsoc-dev
>>>
>>>
>>
>
>
> --
> Best Regards,
> Pranjal Mittal
> B.Tech. 2014
> Indian Institute of Technology,BHU
> Varanasi, U.P,
> India
>
> Github <http://github.com/pramttl> | LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
> Blog <http://pranjalmittal.in>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/gsoc-dev/attachments/20130829/30447ff5/attachment-0001.html>
More information about the gsoc-dev
mailing list