In django my posts are deleted but the files are not. I have a image field in the model which i want to deelete whenever the author deletes it. I'm using generi
I'm creating tests to check that a custom calibration model save function updates an asset record (foreign key) if it is the latest calibration record for the a
I have created a file upload website where I want to allow users to upload files in pdf, ppt, doc, txt, and zip format. I am using the HTML form to upload files
I need to save an object that contains a file and some other data. Although the file is stored on the /media folder, the entity is not saved in the database sin
This is my code associated with the form: # models class Date(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) place
I'm trying to generate a data structure following this sample: [ { "name": "groupname", "key": "grouping1", "base_templates": [ { "i
So i want to make models form to upload file mp3. I was copy the code from website, but suddenly it's not work. there's no error message in terminal or console
Say I have the following models: class ParentModel(models.Model): parent_field_1 = models.CharField(max_length=10) parent_field_2 = models.CharField(max
I've added a Comment model to my application, but when the form is submitted, this error pops: NOT NULL constraint failed: blog_comment.post_id Here's models
Collecting psycopg2 Using cached psycopg2-2.9.3.tar.gz (380 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup
i have relation between Project and ProjectFloorPlan, and i want to display ProjectFloorPlan data in my template. Please let me know how i can display the Forei
i have relation between Project and ProjectFloorPlan, and i want to display ProjectFloorPlan data in my template. Please let me know how i can display the Forei
I have two classes in my sqlite database, a parent table named Categorie and the child table called Article. I created first the child table class and addes ent
I have added foreign keys to some of the models in a Django application but the changes are not being reflected in the MySQL database even after migrating them.
I am trying to handle ProtectedError exception and try to post a custom error message in my template. def delete(self, request, *args, **kwargs): obj = sel
So i want to make models form to upload file mp3. I was copy the code from website, but suddenly it goes error. Here's error message on the website : Forbidden
In a django 2.0 app I have a model, called Document, that uploads and saves an image to the file system. That part works. I am performing some facial recognitio
I am trying to build a website that users can add the courses they are taking. I want to know how should I add the ManyToMany relationship. Such that we can ge
What is the difference between the Model.clean() method and the Model.clean_fields() method?. When should I use one or the other?. According to the Model.clean
I'm trying to extend the built-in user and add some more information to it. I have two apps in my django project- general and user_details. Inside my user_detai