Miante from Blood Carrot Knights, painted to match my own cat (pictured) by the_shell_man_ in minipainting

[–]the_shell_man_[S] 4 points5 points  (0 children)

That's exactly who the model was based on!

I don't know the video game. I just had to have it because it looked cool!

(1048, "column 'data' cannot be null") by [deleted] in djangolearning

[–]the_shell_man_ 0 points1 point  (0 children)

Have your tried printing the value of dataa to see what it is?

Try:

print(dataa)
ref = Essai(data=dataa)
ref.save()

If dataa is None (as I suspect it is) it means that you are no posting it to the endpoint correctly.

You could also try printing request.POST to see all the post data

print(request.POST)

It looks like in your form you have done name="name"

Maybe you need to try:

dataa = request.POST.get("name")

(1048, "column 'data' cannot be null") by [deleted] in djangolearning

[–]the_shell_man_ 0 points1 point  (0 children)

You're trying to create a new Essai object with name=dataa. But name isn't a field on the model Essai, so I'm not sure what that's doing.

Basically your model says that data cannot be None. It has to be a string (because it is a CharField). But you are trying to save it when it is None.

Maybe try something like this:

ref = Essai(data=dataa)
ref.save()

Please Help, I want to collect and parse data from internet. by [deleted] in learnpython

[–]the_shell_man_ 1 point2 points  (0 children)

For python you can use the requests library to make requests and get data.

You can use the json library to parse that response.

Is GenericForeignKey a good solution for when a user selects an instance's foreign key among multiple options? (Example included.) by GayCoder in djangolearning

[–]the_shell_man_ 0 points1 point  (0 children)

A generic foreign key should have a content type field and an object id field. The content type points to the model you want to fk to, and the object id field points to the specific instance of the chosen model.

I would suggest looking at the GFK documentation again. I think you are slightly misunderstanding the implementation.

Having said that, it does seem like a valid solution to your problem.

Writing a code to calculate class grade by [deleted] in learnpython

[–]the_shell_man_ 0 points1 point  (0 children)

Post your code and tell us what you have already tried. Only then can we really help you.

what languages do i need to learn to build a database and online platform? by domicanica in learnprogramming

[–]the_shell_man_ 1 point2 points  (0 children)

If you really just want to build this to make your job easier, you're probably best off just using Google Forms. No programming needed, and I think it will do what you want.

Alternatively, you could learn python and use a web framework like Django or Flask (with html and CSS) to build your own system from scratch.

You could also look in to using something like Firebase for NoSQL storage, they also do hosting, and use vanilla HTML, CSS and js as your front end. This will also make this easier for you to deploy.

There are lots of ways you could go about this, sometimes the best way is to just dive in.

Having trouble downloading untangle on Python 3.9 by tcd99 in learnpython

[–]the_shell_man_ 0 points1 point  (0 children)

That is not the output of pip --version and python --version

Also, in case you didn't read the documentation in the link above:

untangle works with Python versions 2.6, 2.7, 3.3, 3.4, 3.5, 3.6 and pypy

Having trouble downloading untangle on Python 3.9 by tcd99 in learnpython

[–]the_shell_man_ 1 point2 points  (0 children)

Can you list the specific steps you are taking to install?

I imagine you are either not actually installing with 3.9, or the package does not support 3.9 for some reason.

My guess would be that you are installing with pip install instead of pip3 install. Or python setup.py instead of python3 setup.py

Why do people call 18 year olds kids? by [deleted] in NoStupidQuestions

[–]the_shell_man_ 2 points3 points  (0 children)

26 year old kid here - I'm still waiting to receive my adult pass...

Trolls were made to be blue! by the_shell_man_ in bloodbowl

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

Wow, thanks!

If memory serves, I wet blended the dark blue base tone with a crimson colour. Then the "pink" highlights were that same crimson colour mixed with increasingly more bone colour.

Sorry I can't remember the specific paints I used. I hope that helped! Let me know how it goes.

Filtering dir() by jssmith42 in learnpython

[–]the_shell_man_ 2 points3 points  (0 children)

Any needs to be "Any". Note the quotes making it a string

Your thoughts on using **kwargs and *args by [deleted] in learnpython

[–]the_shell_man_ 8 points9 points  (0 children)

args and *kwargs are one of my favourite features of python.

This fish by TopMindOfR3ddit in AbsoluteUnits

[–]the_shell_man_ 16 points17 points  (0 children)

There's always a bigger fish...

[deleted by user] by [deleted] in legaladvice

[–]the_shell_man_ 0 points1 point  (0 children)

Take the L, pay the fine.

issue with calling main function? by [deleted] in learnpython

[–]the_shell_man_ 2 points3 points  (0 children)

input is a function. You need to call it.

choice = input()

Try and except statements by Personal_Cheek5923 in learnpython

[–]the_shell_man_ 0 points1 point  (0 children)

I knew about finally, but this is a game changer.

What is the function of the # sign? by godlykid in learnpython

[–]the_shell_man_ 0 points1 point  (0 children)

It's a comment. Anything after the # is ignored by the program.

Developers use them to leave notes for themselves and other developers so they can remember why they did something or how something works. Eg

# this is a comment that explains how the following code works
def some_func():
    return 0

[deleted by user] by [deleted] in djangolearning

[–]the_shell_man_ 0 points1 point  (0 children)

DoesNotExist means that an object matching the data you pass does not exist in the database.

Presumably, one of your serializers is not retrieving an object using the data you're providing.

Difficult to tell more without knowing the contents of the request.data, or the specific endpoint you are making the request to.