kalloc
and flake8 didn't
Mirco
flake8 usually ignoring models import error
Check out if there's some flake8-* for that , I don't remember
kalloc
but, unfortunately https://github.com/PyCQA/pylint-django/issues/188
Mirco
flake8 usually ignoring models import error
Shouldn't pycharm give ya warnings about that ?
kalloc
sorry, but I'm a vim adopted guy
Rohan
I think I've reached to the point where I trust in my imports and don't rely on linters
kalloc
and I need CI&CD linters
Rohan
and I need CI&CD linters
You can put that specific one in ignores
kalloc
looks like flake8 ignore all models modules
kalloc
def create(self, data): driver = data['driver'] doc = models.DriverLicence() doc.driver = driver return self.update(doc, data)
kalloc
in codebase
kalloc
models does not have driverlicense class
Rohan
Yea, but it won't complain
Rohan
I understand
kalloc
pylint got it, flake8 didn't
Mirco
pylint got it, flake8 didn't
They cannot cover everything, you can double check by yourself or tests should help ya
kalloc
yeap, sure
Mirco
Or even better, if u have an idea to solve that issue, contribute to the project
kalloc
but i don't have a time
Felipe
Hey guys! I have an model Movie that have a many to many relationship to another model Prizes. I want to created a filter of movies by prizes. But one movie can have a lot of prizes. I'll send the search values on url, API/movies/? prizes=1&prizes=2
Felipe
When I try to get the value of prizes to filter it I can only get the last passed on url
Felipe
How can I receive all the values of prizes passed on url?
Mirco
How can I receive all the values of prizes passed on url?
Use just one param prizes with the values comma separated
Felipe
On frontend?
Mirco
On frontend?
Yup, on Django side u should get a list when you get query string param
Felipe
Great! Thank you!
Mirco
Great! Thank you!
Yw 😊
Anonymous
I'm getting trouble to integrate tastypie API with social login, using flutter anyone did it already?
Nedd
Hey everyone, how would I invoke a view to do an action when there's no human interaction involved
Nedd
Hey everyone, how would I invoke a view to do an action when there's no human interaction involved
Allow me to explain further. I already have a function in a view that's invoking a form. Now what I want is another view to perform pythonic operations on the uploaded audio file. Any ideas on how to do that
inchidi
what do you want to do and what do you want to solve?
Anonymous
you have two problems here, first "user=first_incident", first_incident is a ScrumyGoals object
Anonymous
the error says specifically it should be a User
Anonymous
also, you probably shouldn't be creating a user every time you hit the view, you should probably be using request.user (assuming you're using the auth framework)
Anonymous
how about you set: "user = User.objects.create("blah")" and then use that same user reference for both first_incident and added
Naveen
while creating clearly assign the foriegn key model field to "user"
Naveen
if everything is right and you have tried everything. You can try running all migrations stuff again after clearing the database if possible.
Nedd
Hey everyone, for some reason the line "form.is_valid:" is not being true causing an error
Naveen
Hey Man ! you are assigning user as a string thats wrong
Naveen
you need to paas a user object
Nedd
Error: the view didn't return an httpresponse object. It returned None instead
Nedd
use brackets
Tried that as well, didn't work either
Naveen
send the code then
Naveen
yup
Naveen
it should return something
Naveen
you can use render HTTPresponse and other methods to return
Nedd
https://pastebin.com/tsSJgM8A
Naveen
traceback of error
Naveen
code seems correct
Naveen
return statement at the end is in else block
Nedd
No but there is a return statement in the if block as well which is an HTTPResponse only
Nedd
Also I have added the Traceback to the orginal paste
Naveen
apply brackets after is_valid()
Naveen
done ?
Nedd
Yeah
Nedd
No change
Naveen
still getting the error ?
Nedd
Yep
Naveen
then your form is not valid
Naveen
if form is not valid no httpresponse object will be returned
Nedd
Ok so any suggestions on how to fix that?
Naveen
you need to set else with form.is_valid()
Naveen
like
Naveen
If form.is_valid(): return Httpresponse("Done") else return Httpresponse("Error")
Naveen
or more specifically try to use django cleaning of forms to raise Validation errors at time of form so that form is always valid before it enters the view.
Nedd
Ohh
Nedd
I'll try to do that
Nedd
Although idk what cleaning needs to be done on a title filed and a audio upload field
Naveen
use modelform
Nedd
use modelform
Using that only now.
Nedd
So I did a bit more debugging and came to a really nice conclusion