9 | Django Signals like post save | by Hardik Patel

  Рет қаралды 14,800

Hardik Patel

Hardik Patel

Күн бұрын

Пікірлер: 33
@as00060
@as00060 4 жыл бұрын
I have seen many videos on Signal, but your one is the most closest to what I intend to achieve.
@pratikrane149
@pratikrane149 5 жыл бұрын
12:16 SimpleIsBetterThanComplex. That django guy rocks!
@serdalaydogmus
@serdalaydogmus 4 жыл бұрын
amazing explanation. thank you
@abhishektripathi68
@abhishektripathi68 Жыл бұрын
Can you please explain little bit about foreign key relation
@HardikPatelN
@HardikPatelN Жыл бұрын
Foreign key is storing multiple records for one record in other table. Parent Child - FK(parent I'd) Parent can have multiple children
@vinodkumarkopperla2217
@vinodkumarkopperla2217 6 жыл бұрын
when i try to get u.profile it showing that u object doesn't has profile attribute, anything wrong???
@chip911
@chip911 4 жыл бұрын
This video tell exactly what i wamted to to but Can u please make a video on M2M key change eg what ids are added and what ids are removed from that M2M field, itll be great
@chip911
@chip911 4 жыл бұрын
@@HardikPatelN im new at this so can u refer some thing that will help..
@hrutujaranpise8482
@hrutujaranpise8482 6 жыл бұрын
while saving : u.save(). am geting this error :IntegrityError: UNIQUE constraint failed: auth_user.username.........can you plz help me to fix it?
@Magistrado1914
@Magistrado1914 4 жыл бұрын
Excellent course 02/10/2020
@ashikurrahman8874
@ashikurrahman8874 5 жыл бұрын
i can't understand user=2 because user is one to one field and may be user = User().here are you assign user=User. id?
@pratikrane149
@pratikrane149 5 жыл бұрын
The user.id field automatically increments when the new user is created, therefore you don't have to explicitly enter value of user.id when registering user.
@85brijesh
@85brijesh 4 жыл бұрын
Sir, Thank you for your video. I tried the code for foreign key instead of one-to-one field. Its working when any new object is created but while I am updating the object, its not working. Can you explain it in more detail. It will be very helpful for me. Thank you.
@85brijesh
@85brijesh 4 жыл бұрын
@@HardikPatelN class PlatformFabCost(models.Model): facility = models.ForeignKey(PlatformTonnage,on_delete=models.CASCADE,null=True, blank=True) jacket_fab_cost = models.PositiveIntegerField(null=True, blank=True) def save(self, *args, **kwargs): self.jacket_fab_cost = int(0 if self.facility.jacket is None else self.facility.jacket) * (StrFabRate.objects.filter(active=True,structure_id = 1).values_list('fab_rate',flat=True))[0] @receiver(post_save, sender=PlatformTonnage) def create_platform_fab_cost(sender, instance, created, **kwargs): if created: PlatformFabCost.objects.create(facility=instance) else: instance.platformfabcost_set.all()
@85brijesh
@85brijesh 4 жыл бұрын
@@HardikPatelN While updating jacket field in PlatformTonnage, jacket_fab_cost is not updating
@85brijesh
@85brijesh 4 жыл бұрын
@@HardikPatelN Thank you sir.
@azerabishov1369
@azerabishov1369 5 жыл бұрын
When i write "if created: Profile.objects.create(user=instance)" i get error such as "class Profile has no objects member". What is a problem?
@azerabishov1369
@azerabishov1369 5 жыл бұрын
@@HardikPatelN ibb.co/YtKTp7r
@firstnamelastname4685
@firstnamelastname4685 6 жыл бұрын
User object has no attribute profile. So, the line of code, else: instance.profile.save() has some problems Could you help me
@firstnamelastname4685
@firstnamelastname4685 6 жыл бұрын
i know , i didn't get any problem creating a user, but when i want to access the admin page, this error pop out, But for one to one relationship, i do think User.profile should be working , because it is the feature of one to one, right? one to one automatically give both the User and Profile an additional attribute
@firstnamelastname4685
@firstnamelastname4685 6 жыл бұрын
it is very clear , thank you sir
@firstnamelastname4685
@firstnamelastname4685 6 жыл бұрын
may i kindly ask you one more question? Now i know how to extend the user. But I would like the user to fill in their additional information(designation, salary) in a different form after the sign up. How to do that?
@abdull7804
@abdull7804 6 жыл бұрын
Hi Hardik, I am getting the error i.e UNIQUE constraint failed: auth_user.username, while giving that c=User(first_name="hardik") c.save()
@abdull7804
@abdull7804 6 жыл бұрын
Ok, Thank you
@vinaykakanuru
@vinaykakanuru 4 жыл бұрын
Hey Aarav I have tried many times but when I'm saving u.first_name i am getting user has no attribute profile attribute error can you please help me how to resolve this error
@vinaykakanuru
@vinaykakanuru 4 жыл бұрын
Thank you Arav for quick reply. It is working now.
@VivekKBangaru
@VivekKBangaru 6 жыл бұрын
this video is hard to understand. can you please clarify it again with the new. I couldn't able to understand..
@satyveersingh8026
@satyveersingh8026 5 жыл бұрын
Sir Kuch video main apki awaaj clear nhi h
@AnthonyPaulT
@AnthonyPaulT 5 жыл бұрын
Can’t understand shiet
@arunsharma4709
@arunsharma4709 7 жыл бұрын
Ist
@VivekKBangaru
@VivekKBangaru 6 жыл бұрын
Not a list. **kwargs is the Dictionary(key value pair parameters to the function!)
@manunegi5817
@manunegi5817 6 жыл бұрын
*args is not list its tuple
10 | Getting Started with Django Template | by Hardik Patel
17:48
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
28 | How to work with ImageField in Django | By Hardik Patel
20:16
Hardik Patel
Рет қаралды 23 М.
Python Signals - Building a web app with Django - Part 11
19:12
Andreas Jud
Рет қаралды 2,1 М.
Learn the Basics of Django Signals
22:37
Matt Freire
Рет қаралды 50 М.
Custom Django User Model // DJANGO Tutorial
1:04:40
CodingEntrepreneurs
Рет қаралды 157 М.
Как устроен PYTHON
37:44
про АйТи | IT Pro
Рет қаралды 32 М.
15 | Login, Logout using Django Authentication | by Hardik Patel
18:37
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН