Re: Use tables from database with creating models

2018-10-16 Thread Rakhee Menon
NoThere is nothing as such that I hate models...InFact models have made our work easy...Its just that I am working on an old project where all the tables were created...which was not in django so I didn't knew how to access them without models... -- You received this message because you

Re: Use tables from database with creating models

2018-10-16 Thread Joel
Any reason why you hate models? On Wed, 17 Oct, 2018, 11:16 AM Rakhee Menon, wrote: > > > Yes Thank You.. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email

Using Primary key in two fields

2018-10-16 Thread Rakhee Menon
Hi Everyone, I have a scenario where one field needs to be a primary key and another field needs to be an AutoFieldand Autofield requires a condition primary_key = true I get this error django_reports.MstCompositionFm.makeid: (fields.E100) AutoFields must set primary_key=True. django_repo

Re: Use tables from database with creating models

2018-10-16 Thread Rakhee Menon
Yes Thank You.. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@go

Re: Use tables from a database without creating models

2018-10-16 Thread Glen D souza
Hi, If the Data Base is already present then Django provides an handy command which will translate your Database schemas into Django models You have to run python manage.py inspectdb It will auto generate the models based on the Schema. Best way to access the data present in the db in the Djang

RE: FormModel not validating the fields

2018-10-16 Thread Matthew Pava
It’s difficult to tell with your spacing in the email. The function needs to be inside the class, not outside. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of faizan.fa...@gslab.com Sent: Tuesday, October 16, 2018 4:34 AM To: Django users Subject: FormMod

Re: FormModel not validating the fields

2018-10-16 Thread Andréas Kühne
Hi, Your code is a bit hard to read. Python is whitespace significant and you should have more than one space for indentation of methods in classes and so on. >From what I can see it doesn't look like the clean method is a method in the LoginForm class? Check here for the official docs: https://d

FormModel not validating the fields

2018-10-16 Thread faizan . fayaz
I have created a form using form Model and added the def_clean method but the clean method is not being called . Here are my files models.py class EmployeeData(models.Model): Yes = "Yes" No = "No" Onboard='Onboard' Left='Left' Is_GUEST_CHOICES = ( (Yes, 'Yes'), (No, 'No'), ) STATUS_CH

Re: Help me to Generate CSV through Django View from database - and download the same

2018-10-16 Thread Mohammad Shareef M
Thanks lot Thanks & Regards, Mahammad Shareef M +919741482617 +971501340618 +971581756035 On Tue, Oct 16, 2018 at 2:57 PM mottaz hejaze wrote: > import csvfrom django.http import HttpResponse > def some_view(request): > # Create the HttpResponse object with the appropriate CSV header. >

Re: Django tables with check box and delete button

2018-10-16 Thread Andréas Kühne
Hi, You can do whatever you want with any view - however listview per default only supports get requests. If you want to do a post, then you need to add the code for that yourself - All you need to do is add a method: def post(self, request, *args, **kwargs) Then you need to add the code that sh

Re: Help me to Generate CSV through Django View from database - and download the same

2018-10-16 Thread mottaz hejaze
import csvfrom django.http import HttpResponse def some_view(request): # Create the HttpResponse object with the appropriate CSV header. response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="somefilename.csv"' writer = csv.writer(

Re: Django tables with check box and delete button

2018-10-16 Thread Praveen Kumar
Currently I have a listview and a bootstrap table that displays the number of records. I had tried to use request.method POST, to get the list of checked boxes and feed it back to the delete action. However I get an error stating that 'POST is not allowed 405' and when I looked on the web, somewher

Re: Django tables with check box and delete button

2018-10-16 Thread Joel Mathew
There's not much difference in doing this than what is standard practise. You just create the regular fields, loop over the ones creating multiple rows, assign unique name fields to each of them (you can use {{for.counter}} for this). You then capture the request with request.POST.getlist. On T

Django tables with check box and delete button

2018-10-16 Thread Praveen Kumar
Hello, Is there any django standard ways of creating a table with check boxes and let the user to select multiple rows using check box and the delete? Appreciate if anyone can help to provide an example to achieve this. Thanks, -- You received this message because you are subscribed to the Goo

Help me to Generate CSV through Django View from database - and download the same

2018-10-16 Thread Shareef 617
Help me to Generate CSV through Django View from database - and download the same -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@goog