Andy Dirnberger

Andy Dirnberger 432 points

Lead Developer, CBS Local

Andy Dirnberger's Commits

Aug 1, 2012

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Move active flag, part 4 Part 4: remove `ActiveShow` completely.

2e1ba72a7324e7c74d08f31657c863ed34004578

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Move active flag, part 3 Part 3: add active flag to the show admin (this should have been in part 1).

7952504ffebcea69cacf539b2995f1775ad4d884

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Move active flag, part 2 Part 2: add a data migration to move the active flag between `ActiveShows` and `Show`.

ac3b7917292547bece3be0309f1c8af7c2265508

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Move active flag, part 1 Part 1: add the active field to the `Show` model.

c258efecbce8c8d5f4f2bee9f4a4d54e7000abff

Jul 31, 2012

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/dt-54-share-window-functionality' into develop

d40b8998d1e0c2e732555071b89ebf044464ff45

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge remote-tracking branch 'origin/dt-80-update-ad-calls'

abe63af56949a09780ae0a93aabed4dde2a82eef

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Build out ad tags The ad tag URLs are now generated by a template tag. They also contain way more information than they originally did and support a `noscript` version as well.

5527ed0ea046077443f664c86e0fe178495867fc

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/dt-37-social-share-graphic' into develop

17139e804264eb0ea2d92cbc6e68a82a2c3d2837

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

18372df516ff190f109c79a3233183e1947ccba4

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

de26d68cfd0476e2004b63bc6a6c99c2cdfa6f85

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add missing if When generating the index page, the `stationId` variable is set when a user has requested a specific station. It shouldn't write out a value when a station isn't requested. This if should have been included in 116234d but I forgot it.

9c9e9b163182209935d9702a4e1dc41911b05eb1

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge pull request #27 from cbslocal/refactor-api-client Add a management command to update cached data

8df08ddf2fb0634a743cde5b20d8e16b3b72389b

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add a management command to update cached data This management command can be used to update data received from the API. It calls the `_get_from_cache_or_remote()` method directly, passing it `True` for `ignore_cache`. It is important that this command is updated to reflect not only new API calls, but changes to the aforementioned method as well.

4eddf852685bc9bf9f34393f6ae83688d33fd6b8

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

a6525301ef462dc32453103556fc57a036334834

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/dt-79-modal-when-publish-response' into develop

0073294e5d2b9a8bb5c83a0eb7f79345afb76281

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/dt-37-social-share-graphic' into develop

edfc051447fd88aabeb7bf5280dadfa0c0898d78

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

817f5befbb272bf795c035413f800a2a4fe07fa9

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge remote-tracking branch 'origin/master' into working_player

c4b8d7670df39fe99423ca6860754e528583aba6

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge pull request #26 from cbslocal/refactor-api-client Refactor api client

a0db75e513f175a0f90f3e78792ca90c22fc9453

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add pretty URLs A station can now be loaded by going to `/player/[SLUG]/`. This will take priority over the `station_id` query var. When a valid station is requested, its ID is injected into the JavaScript and used before checking the query string. The handling of invalid stations will follow.

116234dca28f1b0e23eb53b2aecaf49e67a844be

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Remove unnecessary parameters to HttpResponse objects `HttpResponse` objects use 200 as the default `status_code`. Therefore there is no reason to manually set it as well. Also, `mimetype` is a legacy parameter; `content_type` is the proper one to use. Additionally I am renaming the response object to `response` from `req` (request?).

adb8c32e2469059444cc51fb926c29a620cbfdb4

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Remove manual calls to gzip middleware Since middlewares already process each request, there is no need to manually call it from views as well.

5a09ec44424ced761357e253b97cf0f6c3883f84

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Update HTTP access to use Requests Requests is already included in the base Pip requirements file. Why anyone would then choose to use urllib instead is beyond me.

d0a06158f19461a8ae6d61f4b5569f26ff37f8ca

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add ability to force API client to refetch data from the remote When the `ignore_cache` parameter is set to `True`, the cache check will be skipped and the data will be refetched from the API. Just as before, the result will be cached for an hour. Currently there is no protection against repeated calls when there is no response or result to cache. Since I was adding a new parameter to the `_get_from_cache_or_remote` method, I decided to rename `attr` to `action` as this seemed to fit with the API terminology a little better. I also elected to improve the method's docstring to better document the parameters.

94ee9d44ccef7a450c285e219d46b7e63d11d532

Andy Dirnberger

https://github.com/dirn/django-heroku-redisify

Add support for openredis Unfortunately this service is still in private beta so I haven't tested been able to test it yet. According to the Heroku Dev Center documentation, though, the config setting will be called `OPENREDIS_URL`. The existing tests are much improved now as they should all handle setting, unsetting, and restoring all environment variables as needed.

e4727ec02c1ef35dd71b5f29dadb148226200dc1

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Remove get_cached_data() With the introduction of the client API wrapper class, the `get_cached_data()` method is no longer needed. :fireworks:

3e47effb9000f7739c998aae4af75ecad74dcc47

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add station types to client API The `API.get_station_types()` method will fetch the list of station types from the API and cache the result for an hour. As of this change, `get_cached_data()` is no longer needed.

ab5b79f639ff01d56c60a364f8020613539ca908

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add gallery to API client The `API.get_gallery()` method will fetch an individual gallery by ID from the API and cache the result for an hour.

299845def52cfcaa94662271aee945345488b805

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add galleries to API client The `API.get_galleries()` method will fetch the list of galleries from the API and cache the result for an hour.

d0c2481f1a9bce45cf557429ba3bc6dbe62c8ae0

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add _get_from_cache_or_remote method to client API It appears that there will be a lot of repetition in the methods contained in the client API wrapper class. The `get_from_cache_or_remote()` method can contain all of the smarts and allow each individual method just to wrap it.

8530d0f5a798c7d2e42c450a54b54d286d5fffb2

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Remove unnecessary guide HTML When the player page renders, HTML for the guide is rendered but is always replaced by the `get_guide_html` view. Also, since stations are no longer passed in through the context, they wouldn't print out anyway.

693403d75897fa49bf6ca6eaac60e2eb43955253

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add station to API client The `API.get_station()` method will fetch an individual station by ID or by slug (ID takes precedence) from the API and cache the result for an hour. As part of this change, the `get_station` view no longer includes the 'objects' key in its response (it probably shouldn't have anyway). The JavaScript needs all references to `objects` removed. Hopefully I got them all.

95749d4b97ea8b34641a7a3aeb03bc278751197f

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add stations to API client The `API.get_stations()` method will fetch the list of stations from the API and cache the result for an hour.

891c75e2b2c13b50f04c4014c23b7793a6952203

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Begin API client class This class is meant to wrap around an instance of `PlayerAPI` and will replace `get_cached_data()`.

8ef653ae100160ca61dd0decc2943fd236fc6cf0

Jul 30, 2012

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge branch 'master' of github.com:cbslocal/The-Impossible-Dream

6271ea5af625968fda28edc9a17072a9942d8f83

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Line endings! Windows needs to be shot in the face. Twice!

adf4ed7adc90b2bfe55ed2f875ee9c7d12914501

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Update guide view for API structure change The market's ID is no longer included in the data returned from Wally. The value for city should be sufficiently unique to take its place here.

1c93372102192fda5e077915b55d29ffb2e70a71

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge branch 'working_player' of github.com:cbslocal/The-Impossible-Dream into working_player

92cb04afd33165315392c3fed8b30a5e485cab6a

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Update guide view for API structure change The station data being returned from Wally now includes station type and format as just the name. Previously it had been returning all data associated with the data models associated with each.

b87b18ccb6d66dd4fec171ecd26dfb8363b432b4

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Merge pull request #11 from cbslocal/gh-8-optimization Fix station structure

5a045aeb09fa9128047f90ddafc8f86e3f3da96f

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Merge pull request #10 from cbslocal/gh-8-optimization Remove last modified logic

3691c8768dcba3cfee0e81d01b7fc3396f7f9887

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

365779e68acda8b50a035bae8176f30ce14835a8

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/more-speed-improvements' into develop

1a31cf6071a767e0736f19b38fb04199b2a93c23

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Remove select_related for ManyToMany field The `ActiveShow` module contains a `ManyToManyField`. As @krolique was quick to point in, `select_related()` performs much better with foreign keys than it does with many-to-manys.

e1f661e712990e585a0760317efa69c41fbbfa3f

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/more-speed-improvements' into develop

cf419bb9120fc89344f3716566df13c6483aa623

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/master' into more-speed-improvements Conflicts: roadshow/scheduler/models.py

48b39975b8bbd5c1c376697a43489f56857dae6d

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Add selected_related to queries All QuerySets in the scheduler app should now use `select_related()` to allow the database to perform the joins for us.

ce646e96e6a11705028bbb78bc25ff6cf9e0cbed

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Testing commit The meat of `ActiveShow.__unicode__()` is being removed for testing purposes.

a82fbba4b7e17983af1a03a1cb9cdcb72a552422

Jul 29, 2012

Andy Dirnberger

https://github.com/dirn/Meetups

Very beginning of the user system The login form is being added here. While it will report form validation errors, there is no actual login functionality yet, so it will report success just by filling in the fields.

de8afb41550ad142203edb29b7e5797f23b2d4ae

Andy Dirnberger

https://github.com/dirn/Meetups

Add placeholder pages for login and registration

7b590f2fbb7218c18c91c543d2470c78503d869a

Andy Dirnberger

https://github.com/dirn/Meetups

add WTForms Now that I can use Pip again, I was able to install Flask-WTF from 51bd52e. Not surprisingly it installs WTForms.

4f79ac2d87ec5043c45f056dc73a72b70814a693

Jul 28, 2012

Andy Dirnberger

https://github.com/dirn/Meetups

Restructure base template By adding blocks to the `body_content` block, templates can control separate areas of the page. By doing this, the top nag can be included on every page from the base template.

2ce6dd77f59c564ac2bc13dc618068180520009c

Andy Dirnberger

https://github.com/dirn/Meetups

Add placeholders for group and space sign up pages Unfortunately I upgraded to Mountain Lion and didn't think to install the new Xcode at the time. Now I can't use Pip yet (to begin using WTF). These are placeholder views and templates to get ready for building them out.

b37a8c710dae21aeb3bc801116dfab463e498b79

Andy Dirnberger

https://github.com/dirn/Meetups

More button adjustments In addition to changing the size of the primary buttons, the text is now being given a treatment to make the action words stand out a bit more.

c848e87f9459585f921ec92b4bf9e412c9b70f94

Jul 27, 2012

Andy Dirnberger

https://github.com/dirn/Meetups

Allow app to run in debug mode By setting an environment variable called debug to 'True' the `debug` flag will be set when calling `app.run()`.

4873dc149398a12fcb87df0b721be21162aca73c

Andy Dirnberger

https://github.com/dirn/Meetups

Adjust primary button sizing The original buttons were a little large. These are a bit smaller and should be more fluid.

eaaf0d1ec85521bfd325beb3890087e66a8509f3

Andy Dirnberger

https://github.com/dirn/Meetups

Fix border radius The definition of the `border-radius` property for the primary home page buttons was overridden by default Bootstrap styles. It takes precedence if it's placed within the `.group-main .btn` declarations. After making this change, the `font` property is left alone. By moving it along with `border-radius`, the `.btn-huge` declaration is no longer needed and can be removed completely.

eb59cc57a2256e5b8d6c3222e411b0250bfb869b

Jul 26, 2012

Andy Dirnberger

https://github.com/dirn/Meetups

Add Bootstrap mixing source file In order to be able to include any of the Twitter Bootstrap mixins, the source file is needed. I'm not sure if others will be needed, but for now I'm just adding this one. The version is 2.0.4.

3886514538c39e0043048bb95a48e83331e02d3c

Andy Dirnberger

https://github.com/dirn/django-heroku-redisify

Clean up Sphinx makefiles When I started the docs I did so by copying and pasting them from another project (as previously noted in 517e5ce). It looks like I failed to update the makefiles as well.

3e6764dbf0374c93b3a34a276b11c414e1c7789b

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

9980d3ef0d1da4106967ea3974926eabadb53950

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge pull request #24 from cbslocal/add-formats-to-guide Hide station grid's immediate children

56f4096cc2c3218e8bfc57927aff2a149ba72c5b

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Hide station grid's immediate children The change I made in 73d0613 introduced a change to the structure of the guide's HTML. This change was also reflected in the JavaScript. When pushing the code up to the preprod server I realized, however, that the JavaScript was up to date while the HTML was stuck behind the hour-long cache. This change targets the station grid's immediate children, rather than using a selector referencing a specific tag. This should allow the JavaScript to work with whichever version of the HTML is being returned.

0467ad8d723efd7414aa790a37744113f813ddc5

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge branch 'master' of heroku.com:stormy-moon-3596 Conflicts: dulcinea/player/urls.py dulcinea/static/js/mediaplayer.js

3c5fd06c647ce15c992ec1ad883ac4aed02e6344

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Clean up README, part deux GitHub-flavored Markdown treats continuous code blocks as one, regardless of how much whitespace is placed in between. This change makes things look better visually when viewing on GitHub.

2cf5cd98d311bbdd5d0a0db43adcc5283d1bb1bd

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Clean up README The initial version (with content) of the README wasn't formatted so nicely for Markdown. Now it is. It is also a little more organized.

a8076df5b37b92f1b227331bd713bca6cf24bf1e

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge pull request #23 from cbslocal/add-formats-to-guide Add formats to guide

289cbf95feaafeadd572e4418381a6b0c33cc659

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge remote-tracking branch 'origin/master' into add-formats-to-guide Conflicts: dulcinea/player/urls.py dulcinea/static/js/mediaplayer.js

91472d8e045da76353ab90b4d32b08559a87d2b4

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Merge branch 'master' of github.com:cbslocal/The-Impossible-Dream Conflicts: dulcinea/static/js/mediaplayer.js

9222ac3e5e4133caa28131ed986af122fcd6100d

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

This is an annoying commit I cannot pull changes from the remote or change branches locally because these two files have Windows line endings and my system keeps replacing them with proper line endings. This should be fun. WHEEEEE!!!!!!

0a430fd8dfd85e49a32b473c5848902ca83d1020

Jul 25, 2012

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Alphabetize formats and locations When displaying station groupings in the guide, it's much better if the groupings are listed alphabetically. To do this, stations are grouped using dictionaries. The dictionaries are then converted to lists. Finally the Django template tag `dictsort` is used to sort the groupings alphabetically for display.

2fedfb01901cb56cf5756e40dcad7f4b48dd9fb4

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Merge branch 'master' of github.com:cbslocal/Walter-Cronkite

0f3e85d8e5b34cb63a3824a026a1fce9678e2809

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Change all resources to use select_related() When fetching a list of 182 stations, 9,989 reads are done from the cache. That's way too many. The problem is that Tastypie makes a bunch of individual queries due to the behavior of the Django ORM. By using `selected_related()` for all querysets, This number will hopefully reduce significantly.

0e9df417550e24e8eb11ad3f0e32e1d03a22a1af

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add formats and locations to station guide In order to better display our music stations, all stations are now grouped by format within type. With this change, each tab within the guide now contains one or more tables. To handle showing and hiding, each tab is now a div (containing the table(s)) instead of a table. The JavaScript had to be updated to accommodate this change. A list of stations by location is also being added to the guide. A location is defined as "City Name, State."

73d06134c4fa023dbd30fe853809b2057dca1b98

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Merge remote-tracking branch 'origin/lwt-1750-audio-roadshow-for-web' into develop

ec06e4a6a7b9118e18047124be5b02c4a48ef83a

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Fix indentation There was a tab. Bad tab!! (All other changes appear to be the result of Windows line endings creeping into the repository. Bad Windows settings!!)

4aab892622222cefe30e26e46fb268bd0937e982

Andy Dirnberger

https://github.com/cbslocal/Audio-Roadshow

Revise up next logic The previous version of the logic used for up next guests had a problem when all guests were exhausted. A `IndexError` would be raised. This new version uses a generator expression which will not only fix the error, but would also be a little more efficient as only the documents needed for processing will be loaded from the cursor. Previously the results had to be converted to a `list`.

55a8d60f98462043bdf2dd6f605da894762c75e3

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Fix a rename missed in f079a4a One reference to the old `contenttype` API module was left behind.

820381546a6a560dee58e352b3124bd645b86a0f

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Remove unneeded fields from Image resource The created and modified timestamps as well as the uploaded by information are not needed in the API resource for images.

17ee9529f4d1892212a974670ae30cd0edf072fe

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Rename contenttype module in API to content_types With the change of name from `cbs.contenttypes` to `cbs.content_types`, the API module should be renamed to match (plus it should have been named `contenttypes` originally).

f079a4a8cd6df60753edeff78d1e95157ed85b14

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Correct Johnny Cache settings The Johnny Cache middlewares need to be added before other middlewares.

ec4bf09fd65f2c2d87f625d5cd4743b01f75f23b

Jul 24, 2012

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Update settings for S3 This adds the custom domain and secure URLs settings for the CDN, disables the query string authentication for static assets, and switches to the cached S3 file storage backend.

84876dc8a4f97e0c5e3703c616c2104fd11286ac

Andy Dirnberger

https://github.com/cbslocal/Walter-Cronkite

Add backend for integrated S3 with Django's cached storage Django's cached storage backend doesn't work with S3. django-storage's S3 backend doesn't work with cached storage. `cbs.common.backends.storage.S3CachedStorage` combines django-storage's S3 backend with Django's caches storage mixing. This will allow us to combine both, getting cache busting behavior for static assets.

6d2e7957f4123a4db586d4358b06b92fcf801ba9

Andy Dirnberger

https://github.com/cbslocal/The-Impossible-Dream

Add support for overriding secure URLs for production S3 URLs If a custom domain is set, we might want to avoid using https for URLs because the SSL certificate will present itself as cloudfront.net when using CloudFront as the CDN.

1fbc560e9c8b767253271366b50d17eb785e18a3