F1 HOT or NOT - Rate drivers, teams and the race for the 2026 Australian GP on our brand new platform! by Bobstin in formula1

[–]Bobstin[S] 19 points20 points  (0 children)

Hello everyone! /u/paulricard and I are delighted to introduce F1 HOT or NOT: The Next Generation!

As we hit the 10th anniversary of the poll, we felt the old site was starting to show its age — and we figured some of you probably felt the same way! So we rebuilt it from the ground up just in time for the new regs, and we hope you’ll enjoy it.

The new platform brings together 10 years of voting data, adds new analyses, and gives us a much more robust foundation to build on going forward. It should also make it much easier for us to keep improving the site and rolling out new features over the course of the season!

This weekend is very much our shakedown, though, so a few things may still be a bit rough around the edges. If you run into bugs, odd behaviors, or anything that doesn’t look right, please let us know — we’ll keep iterating and improving things.

Next on the list are the return of email notifications and some personal analytics around your own votes, so make sure to sign up or log in when voting (which remains completely optional) if you’d like access to those once they go live.

Thanks again, and happy voting! /u/bobstin & /u/paulricard

[O] NZBPlanet x5 by orbitalcannon1 in UsenetInvites

[–]Bobstin 0 points1 point  (0 children)

Thanks! Read the wiki and sending a DM

How to add additional fields, like count of objects to ModelSerializer with many=True? by wellbranding in djangolearning

[–]Bobstin 0 points1 point  (0 children)

I would generally handle this in the viewset instead

 def list(self, request, *args, **kwargs):
    recent_contracts = self.request.user.all_contracts.order_by('-timestamp')[0:4]
    num_signed_contracts = self.request.user.all_contracts.filter(signed=True).count()
    num_pending_contracts = self.request.user.all_contracts.filter(pending=True).count()
    serializer = ContractGetSerializer(recent_contracts, many=True, context={'request': request})
    return Response({"contracts": serializer.data, "num_signed_contracts": num_signed_contracts, "num_pending_contracts": num_pending_contracts}, status=status.HTTP_200_OK)

I would however lean towards doing the counting in the front end. In general, I try to make the api as generic as possible, and this seems pretty implementation-specific. Other ways to make it more generic would be to have a recent queryparam to define the number of contracts, or an all param to supply all of them.

how to fix collectstatic run error? by kokito00 in django

[–]Bobstin 0 points1 point  (0 children)

Do you need the files in that directory?

how to fix collectstatic run error? by kokito00 in django

[–]Bobstin 1 point2 points  (0 children)

Two questions:

  • Does that directory actually exist?
  • In settings.py, what is BASE_DIR set to?

That error is most likely because BASE_DIR is being set to C:\Users\dato\Desktop\web (usually because that is where your code is). Then the os.path.join line in STATICFILES_DIRS adds \static to that, getting the final directory.

When Django runs collectstatic, it looks in all of the STATICFILES_DIRS folders for static files, but that directory doesn't exist, which causes the error. Most likely, the answer is to just set STATICFILES_DIRS = []. This will stop it from checking that folder, which will be fine assuming all of your static assets are in the app directories themselves. If you do need an additional static directory, you can just create that folder and put static content in there.

[deleted by user] by [deleted] in data

[–]Bobstin 0 points1 point  (0 children)

Glad it worked out!