leaguevine add-ons

65 views
Skip to first unread message

Christian Schaffner

unread,
Jan 30, 2012, 9:32:06 AM1/30/12
to leaguevine...@googlegroups.com
This is a repost of an email I've sent to Mark a few days ago, because
it's better to have this mail and his answer on the google group.


Hi guys

We had our first Windmill Windup meeting yesterday which is usually
quite inspiring, sitting in a room with 30+ highly motivated people...
So in the coming weeks, the web team will meet again and look more
concretely into the things that need to get done.

Following our policy of not wanting to "downgrade" on the user
experience, I expect that we want to be able to send SMS announcements
to the teams as we did last year. For doing this, I will probably be
able to re-use some code from last year's stallcount9 project (which was
done in PHP). On the other hand, I've worked with Django a bit recently
and I think I would like to use that framework as back-end for the
public-screen project. I'll look closer into handling team data via
Django and the leaguevine-API soon (also to do some testing).

I think I will write several pieces of code that might be useful for
leaguevine in general, namely:
* parsing and uploading FFindr data to leaguevine
* sending SMS announcement to teams
* handling extended team info, like "City, Country, Phone numbers,
contact info etc."
* handling spirit scores

As you guys are also using Django for leaguevine, I want to do these
things so that you could incorporate them into leaguevine at some point
without much rewriting. Are there any particular rules I should follow?

I find myself re-modeling (in Django) the data structure from your API.
Is there an easier way than going through
http://playwithlv.com/docs/api/
and make according classes with their attributes?


I have a last question: In which league and season does our
international annual tournament best fit, where should it be created?
Is there an easy way to "connect" the three divisions open, mixed and
women, so that people can quickly switch between them (both on the
mobile and the regular site)?

Thanks for your efforts!
Chris

Mark Liu

unread,
Jan 30, 2012, 9:39:04 AM1/30/12
to leaguevine...@googlegroups.com
And here's my reply, reposted in full:

Hey Chris,

First, in general, we should try to keep any conversations like this on the Leaguevine Developers group so people with similar questions can read about what we're talking about if they wish. 

In regards to your questions, my replies are below:

Hi Mark & Roger


We had our first Windmill Windup meeting yesterday which is usually
quite inspiring, sitting in a room with 30+ highly motivated people...
So in the coming weeks, the web team will meet again and look more
concretely into the things that need to get done.

This sounds awesome. That's amazing that you have so many people actively involved.
 

Following our policy of not wanting to "downgrade" on the user
experience, I expect that we want to be able to send SMS announcements
to the teams as we did last year. For doing this, I will probably be
able to re-use some code from last year's stallcount9 project (which was
done in PHP). On the other hand, I've worked with Django a bit recently
and I think I would like to use that framework as back-end for the
public-screen project. I'll look closer into handling team data via
Django and the leaguevine-API soon (also to do some testing).

In response to this and the follow up email you sent about having to replicate our data models, I have a number of thoughts regarding what a backend should entail for a client-side app like this.

It sounds like you are trying to build your own data backend with models/tables. This is certainly a possible approach, but when you're building on top of an API, be sure to consider whether it's actually necessary. A good API layer (which I hope ours is or will soon become), should completely replace any need for a data layer. In fact, our Leaguevine site will soon be rewritten to live entirely off of our REST API, and thus our views/templates will never need to access our models. None of our website logic will import from models, and for the most part, we won't even touch the Django ORM. All of the data will come from the APIs and be written using the APIs.

Client apps such as yours and Chad's will hopefully take this philosophy as well and will not need to worry about the data layer. Your Django views/templates will read data straight from our API without even saving a local copy. If your app loses it's connection, you'll ideally be using HTML5 technologies so your app will still function perfectly, just with slightly out of date data.

Admittedly, it took me some time to wrap my head around this way of doing things, but it's a new web standard and there is good reason for it. For instance, it would be impractical to create a local copies of all the Yelp data, so apps instead use the Yelp API as a data layer in itself.
 
If our API comes up short with certain things, such as spirit scores, then of course your app would have to implement those data models for the scores. However, your app should not have to implement the data model for the teams as well. 


I think I will write several pieces of code that might be useful for
leaguevine in general, namely:
* parsing and uploading FFindr data to leaguevine

Very cool. This almost sounds like a single standalone script. I haven't played with the FFindr API yet, so I'm not sure how easy this is. Keep me updated if you see any incompatibilities here.
 
* sending SMS announcement to teams

Also very cool. This could also be built on top of the API without you having to replicate the data models.
 
* handling extended team info, like "City, Country, Phone numbers,
contact info etc."

Good call with this. When you have to do something like this, it is an indication that our API is failing to offer enough functionality. You might not be the only who thinks the Team resource is too bare bones. I'd love to hear a full list of the info you would find useful, and then figure out which things we should bake into the core of Leaguevine. 
 
* handling spirit scores

Cool. Spirit scores would need their own local data model outside of Leaguevine, but you could relate spirit scores to existing team_ids that you discover from the API.
 

As you guys are also using Django for leaguevine, I want to do these
things so that you could incorporate them into leaguevine at some point
without much rewriting. Are there any particular rules I should follow?


By building an open source, standalone app, you've basically already done everything perfectly for making it compatible with Leaguevine. Since it sounds like you'll build something that will need to be hosted, incorporating it into leaguevine will be as easy as forking a copy and hosting it on a leaguevine subdomain. For instance, a spirit score app could sit at spiritscores.leaguevine.com and it would then be our "official" spirit score app. The best part is that by building it generically so anyone can host it (not just us), someone can later come along, fork it, and build a better one.
 
I have a last question: In which league and season does our
international annual tournament best fit, where should it be created?
Is there an easy way to "connect" the three divisions open, mixed and
women, so that people can quickly switch between them (both on the
mobile and the regular site)?

Thanks for bringing this up. Right now, this tournament probably just falls into one of our generic leagues like "Club Open 2012" but we need to find a way to make it easier for people to jump between related tournaments. It shouldn't be too hard...
 

Thanks for your efforts!
Chris

Thanks a bunch for yours too! I'm really excited to be involved with building all this stuff for Ultimate this year. 

-Mark

Mark Liu

unread,
Jan 30, 2012, 10:43:10 AM1/30/12
to leaguevine...@googlegroups.com
As an additional note on this topic of whether or not client apps should replicate the data models, it sometimes makes sense to perform this replication when the apps are write intensive and you don't intend to write to the API immediately. The Ultistats app is a good example of this, as the sync will be determined by the user to save battery life. Here, the simple solution appears to be to just queue up a lot of API requests. However, this app needs to access past events to determine it's state, so at least some of the data models will likely need to be replicated.

Chadwick Boulay

unread,
Jan 31, 2012, 10:42:35 AM1/31/12
to Leaguevine Developers
If you're ever looking for inspiration to fill out your resources,
check this out:
http://www.sportsdb.org/modules/sd/assets/downloads/sportsdb-27.jpg

They have both a UML designer (happyfish) file and .sql file to go
along with that if you want to try to play around with it. There are a
lot of foreign keys there but there is very little data redundancy!

Buddha

unread,
Jun 18, 2012, 8:50:09 AM6/18/12
to leaguevine...@googlegroups.com
Hi everybody,
finally joined the group and looking into Leaguevine.
First of all: Looks great, tournament handling seems much easier than Ultiorganizer.


On Monday, January 30, 2012 3:39:04 PM UTC+1, Mark Liu wrote:
Cool. Spirit scores would need their own local data model outside of Leaguevine, but you could relate spirit scores to existing team_ids that you discover from the API.

Being part of the WFDF Spirit of the Game group my main focus right now is providing a simple way of recording Spirit scores for a tournament.

I created a small mobile web page for WCBU 2011 (somewhat integrated with Ultiorganizer) and continued from there to something like http://cschneid.com/sotg/

Now I'm looking into Leaguevine and was hoping that I could profit from its infrastructure.
For that I'd need two more fields in game scores plus an API to access it. As Spirit scores are (as of yet) not standardized (althought that's one of the main goals of the WFDF Spirit committee) as well as to be prepared for future updates of the scoring system I'd propose storing a simple string there which could be
- just a number for tournaments using a minimalistic numeric scoring system.
- a string including a prefix, for the current WFDF scores I'd use wfdf-xxxxx with x being numbers from 0 to 4 representing the scores in the five categories. This is simple enough but still extendable if necessary.
e.g.
team_1_sotg_score "wfdf-22321"
team_2_sotg_score "wfdf-12322"

What do you think?

- Buddha

Chadwick Boulay

unread,
Jun 18, 2012, 11:45:41 AM6/18/12
to leaguevine...@googlegroups.com
To be able to run any analysis of spirit scores Mark and Roger would have to do some parsing on the back end and then persist the scores as numbers. There'd have to be some guarantee that the rules for parsing the string were never violated. If the first number's a zero, is that a score of zero or is it simply "01". If the last number's a zero, is it 0 or is it 20? From your description it's pretty obvious, but the data entry point (app) should validate this or limit the input.

Is it possible to enter N/A? (I don't know the categories, but what if one is not applicable?).

Mark Liu

unread,
Jun 18, 2012, 6:25:35 PM6/18/12
to leaguevine...@googlegroups.com
Hey Buddha and Chad,

I love the idea of incorporating SOTG scores into Leaguevine. I have a few concerns with this plan:
  1. The field name "team_1_sotg_score" is too specific to Ultimate. I'd rather it be something like "team_1_sportsmanship_score"
  2. Having this as a field on a game score rather than it's own type of sportsmanship score object seems a bit hacky. It might just be me though.
  3. It would be hard to query on these scores as people could enter whatever they wanted. Thus, they wouldn't be able to easily be used by people besides those who developed the scores.
That being said, for point 2, if we had another field specifying whether it was a sportsmanship score or regular score, maybe that would be enough to make it clear.

For point 3, there might not be a good way around this. Different sports, and even different leagues within each sport will use different systems and this may need to be arbitrarily configurable.

Thoughts?

-Mark

--
You received this message because you are subscribed to the Google Groups "Leaguevine Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/leaguevine-developers/-/IfAfQZtlC1MJ.

To post to this group, send email to leaguevine...@googlegroups.com.
To unsubscribe from this group, send email to leaguevine-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leaguevine-developers?hl=en.



--
Mark Liu
630-738-9280
http://leaguevine.com
http://twitter.com/leaguevine
http://facebook.com/leaguevine

Christian Schaffner

unread,
Jun 18, 2012, 6:43:28 PM6/18/12
to leaguevine...@googlegroups.com
Hi guys

For the Windmill Windup that just happened this weekend, I also wrote my
own little django app which first retrieves all the games from
leaguevine and then lets somebody enter the spirit scores via the admin
form (they were handed to us on paper). The code can be found here:
https://github.com/cschaffner/windmill
It can probably be easily adjusted to be used for other tournaments.

I agree that it would be nice to track spirit scores in leaguevine.
However, I would say that these scores of individual games are somewhat
"private" information. Only tournament averages should be publicly
accessible. Is that correct, Buddha?

Also, I'd say it doesn't make sense if spirit scores are edited later
than a few days after the actual game. So they should somehow be
"frozen" at some point in time (e.g. a few hours after the game was played).

Best regards,
Chris

Mark Liu

unread,
Jun 18, 2012, 7:34:26 PM6/18/12
to leaguevine...@googlegroups.com
That is a very good point about the individual spirit score entries needing to be private. I'm wondering if Leaguevine isn't the right place to hold these scores in this case. Maybe the right approach is to hold the spirit scores in an external database like Chris built and just use Leaguevine for Game data. This would allow individual spirit score apps to configure things however they need.

On the other hand, I do wish this spirit score data were queryable within the leaguevine API so others (including leaguevine.com) could use it and display it. It's just a challenge to make it flexible enough to handle all leagues...

Sorry, this email was basically just my train of thought.

-Mark

Buddha

unread,
Jun 22, 2012, 4:29:08 AM6/22/12
to leaguevine...@googlegroups.com
On Tuesday, June 19, 2012 12:25:35 AM UTC+2, Mark Liu wrote:
I love the idea of incorporating SOTG scores into Leaguevine. I have a few concerns with this plan:
  1. The field name "team_1_sotg_score" is too specific to Ultimate. I'd rather it be something like "team_1_sportsmanship_score"
No problem. I was only half aware that Leaguevine is used outside Ultimate.
  1. Having this as a field on a game score rather than it's own type of sportsmanship score object seems a bit hacky. It might just be me though.

Having an additional object seemed overkill.
Unless you want to controll access to it (which was mentioned in a later post), which is a reasonable point.
If only the administrator and the user who wrote them could read these objects that could mitigate the disclosure issue.
For Switzerland we publish the full per game Spirit scores but the official recommendation from WFDF is to at least publish the average-per-category scores after each day of a tournament.
That's something the Spirit App could handle though.
  1. It would be hard to query on these scores as people could enter whatever they wanted. Thus, they wouldn't be able to easily be used by people besides those who developed the scores.
 I'd imagine that an Spirit app using Leaguevine as storage simply ignores unknown formats. Pragmatic approach, I know :-)

- Buddha

Christian Schaffner

unread,
Jun 22, 2012, 4:58:29 AM6/22/12
to leaguevine...@googlegroups.com
Hi Buddha

> I love the idea of incorporating SOTG scores into Leaguevine. I have
> a few concerns with this plan:
>
> 1. The field name "team_1_sotg_score" is too specific to Ultimate.
> I'd rather it be something like "team_1_sportsmanship_score"
>
> No problem. I was only half aware that Leaguevine is used outside Ultimate.
>
> 1. Having this as a field on a game score rather than it's own type
> of sportsmanship score object seems a bit hacky. It might just
> be me though.
>
>
> Having an additional object seemed overkill.
> Unless you want to controll access to it (which was mentioned in a later
> post), which is a reasonable point.
> If only the administrator and the user who wrote them could read these
> objects that could mitigate the disclosure issue.
> For Switzerland we publish the full per game Spirit scores but the
> official recommendation from WFDF is to at least publish the
> average-per-category scores after each day of a tournament.
Can you please be more precise about that point? Do you mean by "at
least" that ideally, one should publish every spirit score of every game
(in every category)?
That might even be the easiest to implement in leaguevine, because then
one only needs to make sure that the scores cannot be *changed* by
anybody else than the team members (and tournament admins), but they
could be *displayed* to everybody.

I previously had the impression that the specific spirit scores per game
should *not* be known to everybody (e.g. to prevent teams from looking
up what spirit score a specific opponent gave them previously and then
"punish" or favor them in the same way).

Thanks for some additional explanations,
Chris



> That's something the Spirit App could handle though.
>
> 1. It would be hard to query on these scores as people could enter
> whatever they wanted. Thus, they wouldn't be able to easily be
> used by people besides those who developed the scores.
>
> I'd imagine that an Spirit app using Leaguevine as storage simply
> ignores unknown formats. Pragmatic approach, I know :-)
>
> - Buddha
>
> --
> You received this message because you are subscribed to the Google
> Groups "Leaguevine Developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/leaguevine-developers/-/3MVwJ4h7S7EJ.

Louis Abramowski

unread,
Jun 22, 2012, 12:23:17 PM6/22/12
to leaguevine...@googlegroups.com
Hey guys -

Something worth considering here is that perhaps the best way to address the issue with the openness of SOTG scores is by introducing privacy to each data point in the profile data model.  I can think of other scenarios where the data is relevant and worth reporting on, but my not be visible to everyone … i.e. "weight" for a female softball player or maybe "travel calls made" :)

Maybe rather than not including it, maybe you can add it with a privacy setting set to "admin only"

Just a thought.

Lou

Mark Liu

unread,
Jun 25, 2012, 3:43:41 PM6/25/12
to leaguevine...@googlegroups.com
Hey everyone,

This is some good discussion so far on the topic of spirit scores. 

After some thought, I think I am in favor of the pragmatic approach of adding a field to the game score objects that allows spirit apps to enter whatever text string they would like. This gives developers more flexibility to build exactly what they need.

As for the permissions on these scores, we want to keep our permissions structure absolutely as simple as possible. Right now, this means everything entered into leaguevine that is live should be accessible to everyone else. The only things that have a "hidden" period are tournament schedules that need to be constructed before they can be shown to the world. Restricting viewing permissions on this muddies the water, and breaks from this general philosophy of all data being public. So, while I'm all for adding an additional field for spirit scores, I'm opposed to having these be semi-private.

In the future, we will likely have paid addons to the site where you can do private things (i.e. private stats, private leagues, etc), but that's not part of our core offering.

Let me know your thoughts on this, and whether you want me to go ahead with adding the sportsmanship_score field.

-Mark

Buddha

unread,
Jun 26, 2012, 5:25:33 AM6/26/12
to leaguevine...@googlegroups.com
On Friday, June 22, 2012 10:58:29 AM UTC+2, Chris wrote:
> For Switzerland we publish the full per game Spirit scores but the
> official recommendation from WFDF is to at least publish the
> average-per-category scores after each day of a tournament.
Can you please be more precise about that point? Do you mean by "at
least" that ideally, one should publish every spirit score of every game
(in every category)?

With "by least" I meant that we had a range of options within the Spirit group on how much should be published. Some (as me) thought that full disclosure is desirable but some thought that individual game scores could lead to animosities. Therefore we settled on publishing average Spirit scores per category per weekend (for longer tournaments preferably per day) as base line.
 
I previously had the impression that the specific spirit scores per game
should *not* be known to everybody (e.g. to prevent teams from looking
up what spirit score a specific opponent gave them previously and then
"punish" or favor them in the same way).

Some people did fear this kind of reaction from teams (although I think that would be bad Spirit) and here in Switzerland teams actually *liked* the transparency because they could figure out which game(s) was responsible for the score.
But as mentioned above we settled for a little bit less transpacency for now. Hopefully once people got more of a feeling for the scoring system this fear will disappear and the scoring system will be regarded as constructive feedback mechanism, not as ways of dissing your opponent.

Unless there is a big outcry I'd say that the publishing of the scores should be controlled by the Spirit app and if someone really wants to dig into Leaguevine to extract the individual scores: So be it.

Opinions?
- Buddha

Christian Schaffner

unread,
Jun 26, 2012, 6:38:52 AM6/26/12
to leaguevine...@googlegroups.com
Hi Buddha

Thanks for the clarifications.
I think handling spirit scores should become part of leaguevine, mostly
because leaguevine already knows the game data (opponents, start time
and date, field) that is required for teams to assign their spirit
scores. In that sense, the "spirit app" is the web interface provided by
leaguevine. So players/captains can enter not only game scores but also
spirit scores e.g. by using their mobile phones.

As Mark said in his reply, leaguevine is set up more like a wiki,
meaning that everybody can change any spirit score ever given in any
game. The only "control" mechanism is that leaguevine keeps track of who
changes what. Thinking about it, that kind of "security" should actually
be sufficient: the leaguevine system could issue warnings if spirit
scores are changed:
* later than a few days after the game was played
* by somebody else than members of the involved teams and tournament admins

In that way, it seems fine to have spirit scores for individual games
publicly available on leaguevine, even though it slightly contradicts
the WFDF policy you outlined above.

For Ultimate, I think we should agree on a standard format for spirit
scores now rather than leaving it undefined by allowing arbitrary
strings. I guess such a standard is also in the spirit of the WFDF to
harmonize the handling of spirit scores, isn't it? ;-)

Best,
Chris

Mark Liu

unread,
Jun 26, 2012, 10:56:43 AM6/26/12
to leaguevine...@googlegroups.com
Hey guys,

Good stuff. It seems we're all on the same page that Leaguevine can hold the spirit scores publicly, just as we hold all the other data.

The two points we haven't settled on are (1) if Leaguevine should store the data as plain text strings or in a more organized format and (2) whether the Leaguevine Mobile app should actually handle spirit scoring.

For storing data, I am in favor of plain text strings. I wasn't a big fan at first, but it seems that this would indeed be the most flexible solution. Certain leagues, or other sports may want to implement their own customized spirit scoring systems, and this method would allow them to do so without relying on Leaguevine to change its API. 

For whether or not our app should actually handle the scoring, I'm in favor of having a separate spirit scoring app (i.e. the one Buddha already built). Right now Leaguevine Mobile is fairly generic and works for just about any tournament or sport, and binding that app to a specific set of spirit scoring rules will pigeon hole it a bit too much for our liking. We like the flexibility that a standalone app like Buddha's can deliver. Also, if we keep it a standalone app, Buddha (or any other open source developer) will be able to adapt it quickly in response to any changes to the scoring rules without waiting on Leaguevine to do so.

Thoughts?

-Mark


--
You received this message because you are subscribed to the Google Groups "Leaguevine Developers" group.
To post to this group, send email to leaguevine...@googlegroups.com.
To unsubscribe from this group, send email to leaguevine-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leaguevine-developers?hl=en.

Christian Schaffner

unread,
Dec 2, 2012, 11:19:37 AM12/2/12
to leaguevine...@googlegroups.com
Hi guys,

I would like to pick up our discussion about spirit scores here. More
concretely:
* Mark, can you provide a field for storing the spirit scores on
Leaguevine? Ideally, it should be possible to see who has changed this
field, in order to have some control over who has changed the scores.
* I would then try to build a simple Django-app (without database) that
allows
1. entering data into that field, and
2. provide spirit summaries (per tournament), computed on demand.
As front-end, we might be able to use what Buddha has already built, but
I haven't heard back from him yet.
If things work out, it would be nice to host such an extension on
https://spirit.leaguevine.com or so.

Spirit scores are probably more important in European tournaments than
in the US, and I think it would make Leaguevine a more attractive
product to be used in Europe if it is able to handle these scores.

Best,
Chris
> <mailto:leaguevine...@googlegroups.com>.
> To unsubscribe from this group, send email to
> leaguevine-devel...@googlegroups.com
> <mailto:leaguevine-developers%2Bunsu...@googlegroups.com>.

Mark Liu

unread,
Dec 14, 2012, 11:52:43 AM12/14/12
to leaguevine...@googlegroups.com
Hey Chris,

Thanks for bringing this up again. I'm excited that you'll be moving forward with this spirit scoring app. Hopefully you'll be able to work with Buddha or use some of what he already built.

I'm going to now add a plain text field where you can store spirit scores in our database in any format you wish.

You're probably right in that these spirit scores will be more useful in Europe than in North America. I'm glad you're tackling this problem since I'm sure it'll be useful for a lot of people and you'll have the first-hand experience to build something that fits well with your needs.

Mark
Reply all
Reply to author
Forward
0 new messages