Giter Club home page Giter Club logo

django-mvtester's People

Contributors

ubiquitousthey avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

django-mvtester's Issues

Conflicting Treatment Slugs

In the middleware function process_template_response, the following line is used:
request.session[EXPERIMENT_PREFIX+treatment.experiment.slug] = treatment.slug

This sets the treatment.slug in the session (not the treatment.id). What if there are +2 treatments with the same treatment.slug?

The treatment.slug is later retrieved in middleware function process_view, to reverse find the Treatment it belongs to.
treatment_slug = request.session[EXPERIMENT_PREFIX+goal.experiment.slug]
treatment = Treatment.objects.get(slug=treatment_slug)

If +2 Treatments use the same treatment.slug, then the developer cannot be sure which will be retrieved (or perhaps an error will occur?)

Incomplete Documentation

Unfortunately, I'm not able to run the /example because I'm using django-nonrel on my system. I'm trying to gather as much understanding as I can by reading the code. I will have to modify the code to work with django-nonrel anyway, so I'm just figuring out how. I have deciphered the middleware, but I cannot seem to figure out how much of the rest works. Anyway, I just think it would be good if the documentation clearly laid out the logical flow of how this software is intended to work.

Misspellings

There are a few misspellings through out the code, including the word "experiment".

In decorators.py, the function has_template_experiements is misspelled (usage of it's misspelling also in the /example/view.py).

Running a spell check on the files should resolve the issue.

Unnecessary Database Call?

In the middleware, a database call is made to find goals that match the currently running experiments.
experiments = request.session.get(ACTIVE_EXPERIMENTS,[])
for goal in Goal.objects.filter(experiment__id__in=experiments,experiment__url_pattern__isnull=False):

If there are no experiments, is the database still accessed, or does the filter recognize this and return an empty set without accessing the database?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.