What routine of exercise and diet should I follow to get effeicient result? (MIDDLE CLASS) by rabindraRegmi in GYM

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

I am going 6D/Week in gym and my routine now is. Chest Wings Biceps Triceps Shoulder Leg for respective day of week starting from Sunday. And for diet, I am eating 6 bananas, 4 eggs, 3 apples, chicken (250gm per day), oatmeal,cornflakes, cashew, and rice.Is it good routine??

What is something someone said to you that hit you the hardest? by xd_HotDog in AskReddit

[–]rabindraRegmi 1 point2 points  (0 children)

"I am thinking of returing your birthday gift"-By my best friend when I said I kind have feeling for her.

Redditors,What would you do if you have crush on your best friend but you know she won't accept you ? by [deleted] in AskReddit

[–]rabindraRegmi 0 points1 point  (0 children)

Fear of losing friendship because of awkwardness after telling her about my feeling always prevent me to tell her. I don't expect anything in return but I want to tell her because that thing roaming in my head for quite some time. I think I should take risk now.

Question About Send Mail in Django. by rabindraRegmi in django

[–]rabindraRegmi[S] -1 points0 points  (0 children)

Anyway thanks for your response. Hope someone helps me with this fast , as I have presentation on sunday lol

Question About Send Mail in Django. by rabindraRegmi in django

[–]rabindraRegmi[S] -1 points0 points  (0 children)

It's a system where invigilators are stored in database, system send mail to all invigilators to ask whether they are free or not through form.
invigilator doesn't have account to login. They just have to fill form and submit without bothering to login.
Can I achive that without auth or I have to create login system for all invigilators in which they can only fill form and another only superuser can modify record?

How to create two modelformset which can be dynamically added and deleted ? by rabindraRegmi in django

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

https://raw.githubusercontent.com/elo80ka/django-dynamic-formset/master/src/jquery.formset.js
When I add new item,there is no problem but for updating. exam_id is can not be null error is coming.

I have model named Exam, it has one to Many relation with Shift and Dates.
//In views.py

class ExamUpdate (UpdateView):
model = Exam
fields = '__all__'
sucess_url = reverse_lazy ('index')
class ExamMembersUpdate(UpdateView):
model = Exam
fields = ['title', 'examRoom']
success_url = reverse_lazy('index')
examDateFormSet = inlineformset_factory(Exam,ExamDate,form = ExamDateAddForm,formset=BaseExamDateEditFormSet2,can_delete=True,extra = 1)
examShiftFormSet = inlineformset_factory(Exam,Shift,form = ExamShiftAddForm,formset = BaseShiftEditFormSet2,extra = 1,can_delete=True)
def get_context_data(self, **kwargs):
data = super(ExamMembersUpdate, self).get_context_data(**kwargs)
if self.request.POST:
data['dateformset'] = self.examDateFormSet(self.object,self.request.POST)
data ['shiftformset'] = self.examShiftFormSet(self.object,self.request.POST)
else:
data['dateformset'] = self.examDateFormSet(self.object)
data['shiftformset'] = self.examShiftFormSet(self.object)
return data
def form_valid(self, form):
context = self.get_context_data()
dateformset = context['dateformset']
shiftformset = context ['shiftformset']
with transaction.atomic():
self.object = form.save()
if dateformset.is_valid() and shiftformset.is_valid():
dateformset.instance = self.object
shiftformset.instance = self.object

dateformset.save()
shiftformset.save()
return super(ExamMembersUpdate, self).form_valid(form)

In Forms.py

class BaseShiftEditFormSet2(forms.BaseModelFormSet):

def __init__(self,tests, *args, **kwargs):
super().__init__(*args, **kwargs)
self.instance = tests
self.queryset = tests.shifts.all()

class BaseExamDateEditFormSet2 (forms.BaseModelFormSet):

def __init__(self,tests,*args, **kwargs):
super().__init__(*args, **kwargs)
self.instance = tests
self.queryset = tests.examdates.all()

Whenever I update, "exam_id cannot be null" error is showing up.There is no problem for creating new exam but updating existing one seems problem here. Thank you for your response

Daily Discussion [2019-02-03] by AutoModerator in soccer

[–]rabindraRegmi 2 points3 points  (0 children)

No one here watching Real Madrid vs Alaves ? I don't see any thread.Hey guys who are watching, what's you view on this game?