Topic: Rating system
einstein13 |
Posted at: 2019-09-07, 20:37
That is used in some computer languages (haskell? lambda expressions?). Probably mathematicians loves that sign .
As I can see, the main problem is about adding new lines to a form where you put player names and results, right? The general solution for that is:
I know that this is not the only way of doing that, but probably the most straightforward one. @kapputnik, maybe you have another experience with that and you can share it with us? Maybe there is even easier way to do that? Admin pagesIn the admin page there is a possibility to add inline form (related list), and this functionality is done automatic einstein13 |
trimard Topic Opener |
Posted at: 2019-09-07, 20:49
The most cryptic the better for them right? Not so far from medicine on that aspect :P.
yup exact procedure I used. Except for some reason, django doesn't show the "player-x" names, only the first one which I didn't create automatically. Somehow the list appearing in the request is linked to the template?? I have the exact same html input for each lines (except names and id). I can't find anybody else with the same exact problem. I think people don't use django to make their own form...
Ok, +1 for admin page, but I still need to override the html from what I understand to do that. Did I read wrong? Top Quote |
einstein13 |
Posted at: 2019-09-07, 21:51
Django forms were designed for admin pages and form views (as I remember). Using them in customized views can be hard. Probably easier is creating whole form from scratch. But don't listen to me I might be completely wrong . My guess is that designed form with form class is handling only input that is defined in the class itself. To cover all other cases (custom lines) you need to override methods responsible for reading data from GET / POST request.
+1
Yes, but in general you don't have to use only one page for all data! You can use multiple forms, one for each functionality. And as I understand, only one form is needed as basics: form where you can register game and its results. Also another admin page - list view is needed to review all the games, but it doesn't need to be a form, just buttons "edit" and "add new row". einstein13 |
trimard Topic Opener |
Posted at: 2019-09-08, 16:47
Well that's what I did then, and I found a way to fix my problem. I create 8 players and just hide 6 of them. Then I just hide/show and remove the value when "removing". From a backup point of view, I just check if value is empty of not before adding the player :).
We'll hope you're not I'll use the other part of your post if I decide to do it the pure django way. But a big factor to use that technique I forgot to mention is that I might use the same template and backend for the submission of games by players Now I focus on refacto, and then we could start the alpha tests, a few questions about that btw:
is that cleaner to have:
or an array with these value and a function that call them? Rest of the work to do in the next few weeks:
Edited: 2019-09-08, 19:10
Top Quote |
GunChleoc |
Posted at: 2019-09-08, 17:08
Is there a specific reason that you need the int representation? This will break as soon as we add the amazons. Busy indexing nil values Top Quote |
trimard Topic Opener |
Posted at: 2019-09-08, 17:21
Mhhhh, true actually we could just use strings, but in the end I think we would need a tribe table anyway. At some point we will want to have a score per tribe, so why not reference to the tribe table? We could manage the tribes, and add them as we want directly on the arbiter page? edit: no, no need for tribe management on the arbiter page, the admin interface will be far enough for such use Edited: 2019-09-08, 17:23
Top Quote |
GunChleoc |
Posted at: 2019-09-08, 17:37
A tribe table sounds good. Busy indexing nil values Top Quote |
einstein13 |
Posted at: 2019-09-08, 20:09
Tribe table is one option, another is to use model for adding valid player-game match:
But this method will require code change when amazons / egyptians / any new tribe would be added. So as GunChleoc said, probably the best method is to add another table with tribes for mapping purpose. But remember to add somewhere initial data filling. I know that data migrations weren't created for such purpose, but it is clean and probably the easiest way to do so. Edited: 2019-09-08, 20:12
einstein13 |
trimard Topic Opener |
Posted at: 2019-09-08, 23:23
Might try a model. And btw shouldn't we have kind of everything in tables?
that is, we will, also at some point want data on those: So is this map balanced for tribe x? Is this type of game favoring a certain tribe? Is this type of game creating too many tie? etc If we do that, we will have to store them so that people looking at those value don't ask for too much load from the server. (we could refind these data by looking at all the games each time) There is no rush though. Top Quote |
trimard Topic Opener |
Posted at: 2019-09-08, 23:55
Oh yeah this is starting to look like a real experiment! Here are the data after different configurations: Test 1 (currently displayed in "call for game")
Same as last + max iteration on step5 :2Same as last + tau: 1.0Same as last + number of game per round: 2Seems some parameter are more sensible than other. well what data you guys would want to test too to understand better the hang of it? Top Quote |