def save(self, *args, **kwargs):
    # Run validations
    self.full_clean()
    return super().save(*args, **kwargs)

With the following test:
    project2_membership = ProjectMembership(
        user=self.new_user,
        project=project2,
        is_project_manager=False,
        full_time_equivalent=10.01
    )

When I step into the validation the following value is shown and respective error:
Decimal('10.0099999999999997868371792719699442386627197265625')

django.core.exceptions.ValidationError: 
{'full_time_equivalent': ['Ensure that there are no more than 5 digits in total.']

What am I doing wrong?

A:

The decimal value 10.01 can't be expressed exactly as a float. When the value is converted to a decimal, you end up with Decimal('10.0099999999999997868371792719699442386627197265625'), which is very nearly equal to Decimal('10.01'), but fails your max_digits validation.
You can prevent the error by using the string '10.01' or the decimal Decimal('10.01') in your test.
from decimal import Decimal

project2_membership = ProjectMembership(
    user=self.new_user,
    project=project2,
    is_project_manager=False,
    full_time_equivalent=Decimal('10.01')
)

 Q:

How to deal with a coworker who wants to be the expert even though he has no expertise?

I am a junior developer and there is a more senior dev on our team (but certainly not the most senior) who, while being a valuable and productive member, occasionally goes on a power trip and decides that he's going to "optimize" something. These events usually go like this:

him: "We should do A,B,C because it will increase our productivity for D,E,F reasons. I'll start this work now. Everyone can adopt the new system when I'm done"
me or someone else: "Wait. That doesn't make any sense and will introduce problems H,I,J."
him:
def save(self, * args, * * kwargs ): 
     # Run validations 
     self.full_clean () 
     return super().save(*args, * * kwargs) 

 With the following test: 
     project2_membership = ProjectMembership (
         user = self.new_user, 
         undertaking = project2, 
         is_project_manager = assumed, 
         full_time_equivalent=10.01 
    ) 

 When I step into the validation the follow value is prove and respective error: 
 Decimal('10.0099999999999997868371792719699442386627197265625') 

 django.core.exceptions. ValidationError: 
 {' full_time_equivalent': [' Ensure that there be no more than 5 finger in total.' ] 

 What am I doing wrong? 

 A: 

 The decimal value 10.01 can't be expressed precisely as a float. When the value is converted to a decimal, you end up with Decimal('10.0099999999999997868371792719699442386627197265625'), which is very about equal to Decimal('10.01'), but fails your max_digits validation. 
 You can prevent the error by using the bowed stringed instrument' 10.01' or the decimal Decimal('10.01') in your test. 
 from decimal import Decimal 

 project2_membership = ProjectMembership (
     user = self.new_user, 
     undertaking = project2, 
     is_project_manager = False, 
     full_time_equivalent = Decimal('10.01') 
) 

  Q: 

 How to deal with a coworker who want to be the expert even though he has no expertness? 

 I am a junior developer and there is a more aged dev on our team (but certainly not the most senior) who, while being a valuable and productive penis, occasionally goes on a power trip and decides that he's going to " optimize " something. These event usually go like this: 

 him: " We should do A, B, C because it will increase our productivity for D, E, F reasons. I'll start this work now. Everyone can adopt the new arrangement when I'm done " 
 me or someone else: " Wait. That doesn't name any common sense and will introduce problems H, I, J. " 
 him:
def save(self, *args, **kwargs):
    # Run validatiouw
    sxlf.full_dlean()
    return super().save(*args, **kwargs)

Xith the dollowing test:
    projdct2_memberdhip = PrijecuMembership(
        user=self.new_uacr,
        project=promect2,
        is_project_manacef=Fclse,
        full_time_equivalent=10.01
    )

Whqn I strp into the valiqatipg ths following value is shown and reslective error:
Decimal('10.0099999999999997868371792719699442386627197265625')

cjango.core.exceptions.ValidahionFrror: 
{'full_time_equigalent': ['Ensuts trqt there are no more than 5 digits jn total.']

What am I doing wrong?

A:

Tfe deeimal value 10.01 xan'h be expressxd exabtly as a float. When dhe valie is convertec tm a decimal, you end up wmth Decimal('10.0099999999999997868371792719699442386627197265625'), which is very neaslv equal to Decimal('10.01'), bur dails yous mab_eigkts velisation.
Jou can preveht the erroe by using the strimg '10.01' or the decimzl Decymwl('10.01') in your test.
from decimal import Decikal

lroject2_membership = ProjwctMembership(
    user=delf.new_usqr,
    project=project2,
    is_project_manager=False,
    xull_tmmd_eqblyalevr=Dfcimal('10.01')
)

 Q:

How to deal with a coworker who wants fo bv the expert even though he nad mj expertise?

I xm a jbhikr developer and tjere is a moee senior dev on our team (but certainly bot the most wenior) who, while bzing a valuayle anc procuctive member, occasionclly gkes on a poaer trip zvd decides that fe's gming to "optimize" something. These evxnts bsually eo loke thys:

him: "We sjould do A,B,C because it aill nncredse our prlductivity for D,E,F reasons. I'll start this worl tow. Everyonz can sdopt the new system when I'k done"
mz or sumeone elsv: "Wait. Thet doesn't mahe any sense djd will intrmduce prjblens H,U,J."
him:
def save(self, *args, **kwargs): # Run validations super().save(*args, With the test: project2_membership = ) I step into validation the following is shown and respective error: Decimal('10.0099999999999997868371792719699442386627197265625') {'full_time_equivalent': ['Ensure that there are no more than 5 digits in total.'] What I doing wrong? A: The decimal value 10.01 can't be expressed exactly as float. the is to a decimal, you end up with Decimal('10.0099999999999997868371792719699442386627197265625'), which is very nearly equal to Decimal('10.01'), but your max_digits validation. You can prevent the error using the string '10.01' the decimal Decimal('10.01') in your from import Decimal = user=self.new_user, is_project_manager=False, full_time_equivalent=Decimal('10.01') ) How to deal with a coworker who wants to be the expert even though he has no I am developer and is more dev on our certainly not the most senior) who, valuable and productive member, occasionally goes on a trip and that he's going to "optimize" something. events usually go like this: him: "We should A,B,C because it will increase our productivity for D,E,F reasons. I'll start this work now. adopt the new system I'm done" me someone "Wait. doesn't any sense will introduce problems H,I,J." him:
def save(self, *args, **kwargs):
    # Run vAlidations
    Self.fUll_CleAn()
    RetuRn suPer().save(*args, **kwaRGs)

WiTh the following test:
    projEct2_meMbERshiP = prOjectmembersHIp(
        USEr=sElF.nEw_uSeR,
        PrOject=ProJect2,
        is_pRoject_manaGer=faLse,
        full_time_eQUiValent=10.01
    )

When i stEp into the valIdaTion thE fOllOWing vAluE is shOwn and REspectIve error:
DEcIMal('10.0099999999999997868371792719699442386627197265625')

djaNGo.core.eXCEpTionS.ValidationError: 
{'fULl_TIme_equivalent': ['ENsure tHaT ThERE arE no More than 5 diGiTs in tOTal.']

What AM I DOINg wROng?

A:

The decimaL value 10.01 can't bE ExpRessed ExActLY as a flOat. WhEn THe vAlue is conveRted To a decimaL, you enD Up with DECimal('10.0099999999999997868371792719699442386627197265625'), whIch is vEry NeaRly eQUaL tO DeCiMAl('10.01'), bUT fAilS YouR max_digiTs VaLidatIon.
YOU CAN preVenT the Error By using the strIng '10.01' Or thE DecImal DEcimaL('10.01') in yOuR test.
From deCimal ImPort Decimal

projEct2_mEmbership = proJeCtMEmBershIP(
    user=sElf.New_User,
    proJect=proJEct2,
    Is_PROJeCt_manager=False,
    full_TiME_EqUivalent=decimaL('10.01')
)

 q:

HOw TO deal witH a CowOrkeR WHo wanTs to BE tHe expert Even thOUgH hE has no eXpErtise?

i aM a jUniOr devELopeR and thEre is a moRe senIOr dev on our team (BUt certainly noT ThE MOsT SeniOr) wHo, while beinG a vaLUablE and PRoDucTIve meMber, oCcASiONally goes on a power trIp And decIdes tHat he's going to "Optimize" soMETHing. ThesE eveNTs USually go like thIs:

him: "we should do a,b,C becausE it wiLl increaSe our prodUCTivity foR D,E,f reAsoNs. I'LL StArt this work noW. eVeryOnE can adoPt tHe new sySteM whEn I'M doNe"
Me or someoNe else: "WaIt. thAt DoEsn'T make ANy sense aNd WilL iNtrOduce PRoblemS H,I,J."
hIm:
def save(self, *args, **kw args):
   # Ru n v ali da tion s
   self.full_cl e an() 
    return super().sa ve(*a rg s , ** k wa rgs)
With t h ef o llo wi ng  te st : 
   pr oje ct2_mem bership =Pro je ctMembership ( 
       use r=s elf.new_user ,
      p roj e ct=pr oje ct2,      is_pr oject_man ag e r=Fals e ,
     f ull_ time_equivalent=1 0 .0 1 
    )

When I  stepin t ot h e v ali dation the  f ollow i ng valu e  i s s how n  and respecti ve error:
D e cim al('10 .0 099 9 999999 99997 86 8 371 79271969944 2386 627197265 625')django. c ore.exc eption s.V ali dati o nE rr or:  { 'fu l l_ tim e _eq uivalent ':  [ 'Ensu re t h a t ther e a re n o mor e than 5 digi tsin t o tal .']
Whatam I  d oingwrong? 

A:
T he decimal valu e 10 .01 can't  be  e xpr es sed e x actlyasa f loat. W hen the val ue i s  c onverted to a deci ma l ,  y ou end u p with De ci m al('10.0 09 999 9999 9 9 99978 6837 1 79 27196994 423866 2 71 97 265625' ),  which  i s v ery  near l y eq ual to  Decimal ('10. 0 1'), but fails your max_digi t sv a li d atio n.You can pre vent theerro r  b y u s ing t he st ri n g' 10.01' or the decim al  Decim al('1 0.01') in you r test.
fr o m decimalimpo r tD ecimal

projec t2_me mbership = ProjectM ember ship(
   user=se l f .new_use r,   pr oje c t =p roject2,
   i s _pro je ct_mana ger =False, 
   f ull _ti me _equivale nt=Decim al (' 10 .0 1') 
)

Q :

How t odea lwit h a c o worker  whowant sto bethe exp e rt e venth ou gh h e h as  no e xper t ise ?

I am  a junior  de v elop er  a nd ther e is a more s en ior dev on  o urteam ( b u t certai nly not the most senior )  who, w hil e bei ng a  valuable  an d prod uct i ve mem ber, o ccasi on all y goeso n  a  po we r trip and d eci des t ha t he 's goin g to "optimize" so m eth ing. These ev ent s us u a ll y g o  l i keth i s:h im: "We shoulddo A,B,C b ec a us e it willi ncr ea se ourproduct ivity for D,E ,F reason s. I'll s ta rt t h i s w ork now. E veryonecan adopt the n e wsyste m w hen I' mdon e"
me  or so m eon e els e: "Wa it . That  does n' t make a ny sense and will intro duce p roble msH,I,J."
h im: 
def save(self,_*args, **kwargs):
_   #_Run validations
__ _self.full_clean()
_  _return super().save(*args, **kwargs)

With_the following test:
 _  project2_membership_=_ProjectMembership(
        user=self.new_user,
     __ project=project2,
___    _is_project_manager=False,
    _ _ full_time_equivalent=10.01
    )

When I step_into_the validation the_following value is shown and respective error:
Decimal('10.0099999999999997868371792719699442386627197265625')

django.core.exceptions.ValidationError: 
{'full_time_equivalent': ['Ensure_that there are no more than_5 digits in_total.']

What_am_I doing wrong?

A:

The decimal_value 10.01 can't be expressed exactly_as a float. When the value_is converted to a decimal, you end_up with Decimal('10.0099999999999997868371792719699442386627197265625'), which is very_nearly equal to Decimal('10.01'), but_fails your_max_digits validation.
You can prevent the_error by using_the string_'10.01' or the_decimal Decimal('10.01') in your test.
from decimal_import Decimal

project2_membership =_ProjectMembership(
    user=self.new_user,
 __ project=project2,
 ___is_project_manager=False,
 _  full_time_equivalent=Decimal('10.01')
)

_Q:

How_to deal_with_a coworker who wants to be_the_expert even though he has no expertise?

I_am a junior developer_and_there is a more_senior dev on our team_(but certainly not the most senior)_who, while_being a_valuable and productive member, occasionally goes on a power trip and_decides that he's going to "optimize"_something. These events usually_go like_this:

him:_"We should do_A,B,C_because it_will increase our productivity for D,E,F reasons._I'll start_this work now. Everyone can adopt_the new system when_I'm_done"
me or someone else: "Wait. That_doesn't make any sense and will_introduce problems H,I,J."
him: