Donation

Help us to pay our server!
(: Consider a donation :)



Social Media

  • Facebook
  • Google+

Latest Posts

Topic: game scheduling module

Forums » Widelands Development » Homepage » game scheduling module



kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1072
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-08-09, 20:31

or I create a disponibilities table which reference the id of a user?

Yes, thats the way it has to go. In Django terms you have to create a model with the fields (database columns) you need and additionally a field 'user' (or similar name) which will be a foreign key field. You can take a look at the 'Vote model in wlpoll/models.py for comparison:

class Vote(models.Model):
    user = models.ForeignKey(User, related_name='poll_votes')
    poll = models.ForeignKey(Poll)
    choice = models.ForeignKey(Choice)
    date_voted = models.DateTimeField(
        'voted at', default=datetime.datetime.now)

The field 'user' creates the relation from/to the model 'Vote' and a registered user (model: auth.user, which is part of the django frame work). After the creation of the model you have to run ./manage.py makemigrations and ./manage.py migrate to get your model into the database. All necessary work in database will be made automatically then. Refer to the Django documentation for more information about the available field types and options, e.g. there is also a DateTimeField available.

Regarding the colors:

Or how about giving the available dates a color, and making the other dates empty boxes?

+1


Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 61
Ranking
Likes to be here
Location: re
Posted at: 2017-08-10, 14:00

Ok thanks a lot Kaputnik, I think I'm almost done (if we ignore all the work that has to be done to check login, clean database regularly, display dates on right order and things like that).

I just need to test the module with another user, but I need to activate new users with mail activation, which is kind of hard in local (I don't want to set up the mails...). Is there any way to circumvent that?


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 1955
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-10, 16:13

You can add new users through the admin interface in admin/auth/user/add/. Then you can set them as active manually too.


Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 61
Ranking
Likes to be here
Location: re
Posted at: 2017-08-10, 17:34

Yes it's working! Thanks !:D

I don't think I'll have time to finish it before I go to vacation though, so I'll do the finitions next week face-smile.png


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 1955
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-10, 19:17

Enjoy your vacation! face-smile.png


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 286
Ranking
Tribe Member
Location: Saxony, Djermany
Posted at: 2017-08-11, 18:54

trimard wrote:

Well, this page can also do the job, and more things: https://dudle.inf.tu-dresden.de/

Oh yes, I use a similar tool pretty often IRL.

The main difference I'm proposing here is that you don't need to know the player before knowing if they are available or not. It's easier to check as everything would be on the same website. Also I think it would become laborious when a lot of player and a lot of date are available. It seems this tools is better for setting one date with a few people you know rather than many dates with many people you don't know. But I never use this specific tool so I might be wrong.

kaputtnik wrote:

The doodle things have one culprit: They are used to find a specific date and time where most people have time to participate.

WorldSavior: How will you make a doodle showing possible play time of players? If one player creates a doodle, how will other players may be informed?

I misunderstood the proposal. First I thought that the tool should just find the right date between players who know each other already and who are already planning that they want to play face-wink.png

So, I don't know if "dudle" could do this. Probably not...


*insert phrase about the necessity of saving the world here*

Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 61
Ranking
Likes to be here
Location: re
Posted at: Yesterday 22:33

Thanks Guncleoc, they were good indeed face-smile.png

No problem worldsavior but you raised a good point though: should we create a module to find games for two players that know eachother? I agree with you that, for now at least, it is unnecessary.

I m progressing but i l having a hard time testing the timezones. I dont know why but i can t change the timezones of the users i created. Is there a trick like the one to create user? There is no option to change the timezone in the admin board..


Top Quote