Thursday, March 29, 2018

Re: How to upload and save excel data in database django

Hi,

I'd export the data to CSV (which is easier to parse), create a Django Command (https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/#module-django.core.management) that will open the CSV and then add the records.

On Thu, Mar 29, 2018 at 7:03 AM, arvind yadav <developer.arvind2289@gmail.com> wrote:
this is may data format 

from django.db import models
class RegisterMember(models.Model):
    GENDER_CHOICES = (
        ('M', 'Male'),
        ('F', 'Female'),
    ) 
    id = models.AutoField(db_column='ID', primary_key=True) 
    name = models.CharField(db_column='NAME', max_length=255) 
    email = models.CharField(db_column='EMAIL', max_length=255) 
    phone = models.CharField(db_column='PHONE', max_length=5000, blank=True, null=True)
    address = models.CharField(db_column='ADDRESS',max_length=255) 
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff305a58-0bf3-4f3e-9edf-adf7db879b80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101  |  Mobile: +55 51 99907 0554

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEM7gE2usqsy-nSGQFm1OirO0zJASTe5Y-1rJ0FNsNPomtxR1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment