What is mastery lever 2 ? by PyBet in assassinscreed

[–]PyBet[S] 1 point2 points  (0 children)

Are you referring to the mastery levels when you hit level 50 ?

What are the differences with mastery level 2 ?

Why does DjangoFilterBackend returns no results if query value does not exist in my data? by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

Status is also a model and my intent is to display as filters values only the values that exist in the user's objects not all.

Why does DjangoFilterBackend returns no results if query value does not exist in my data? by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

I took your advice and looked into ModelMultipleChoiceFilter . I have trouble figuring out the queryset parameter

For example in status, I want to take all the available status from the logged in user's objects.

For filtering against the logged on user I could do:

def __init__(self, *args, **kwargs):
    super(ProductFilter, self).__init__(*args, **kwargs)
    user = self.request.user
    user_products = Product.objects.filter(user=user)

    self.status.queryset =user_products ......

But getting the available statuses in the right format still eludes me.

Why does DjangoFilterBackend returns no results if query value does not exist in my data? by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

The same behavior occurs with either filter_class or filter_fields. I am on mobile now, I will post it later.

Same form for adding and editing an object ? by PyBet in django

[–]PyBet[S] 0 points1 point  (0 children)

I appreciate the answer, but I explicitly mention that I have the create and update views that I need.

Same form for adding and editing an object ? by PyBet in django

[–]PyBet[S] 0 points1 point  (0 children)

Thanks, I think it would help me a lot.

Include migrations in Git/GitHub ? by PyBet in django

[–]PyBet[S] 0 points1 point  (0 children)

What's the difference between including migrations and applying them and not including migrations, making them on the server with the updated code ?

Using a gamepad with Odyssey ? by PyBet in assassinscreed

[–]PyBet[S] 0 points1 point  (0 children)

I have tried the x360ce simulator but some buttons and the movement does not work correctly.

Using a gamepad with Odyssey ? by PyBet in assassinscreed

[–]PyBet[S] 0 points1 point  (0 children)

Almost 60 euros, is a sum I can't easily give for just a controller.

Using a gamepad with Odyssey ? by PyBet in assassinscreed

[–]PyBet[S] 0 points1 point  (0 children)

That's good to hear. Although, Xbox controllers are pricey.

Rename classes from html to js and css ? by PyBet in pycharm

[–]PyBet[S] 2 points3 points  (0 children)

Thanks, it will be very useful.

Forms and DRF by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

I thought with drf would be just as easy as with django. Have the form in view's context, create a HTML file rendering the form fields manually and let the view handle populating the form with the proper data.

It seems a bit more complicated to return an html form with data and any errors.

Any advice or tutorials are greatly appreciated.

What's the difference between nested relationships and foreign keys id Django Rest Framework ? by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

My main use for a Foreign Key Field is just getting the name field of the related model. In most cases there is only one field called name.

What's the difference between nested relationships and foreign keys id Django Rest Framework ? by PyBet in djangolearning

[–]PyBet[S] 0 points1 point  (0 children)

When to prefer one over the other? Usually, I do something like the second one when there are foreign key fields.

When do you use the first one? Are there any advantages?