Re: File handling in Django

2025-02-04 Thread Van Kamanga
Je suis disposé, crache le marché

Le mar. 4 févr. 2025, 15:25, Idohou Sandé Augustin  a
écrit :

> I'm looking for back end developer Django
>
> Le mar. 4 févr. 2025, 06:03, Agar Joshua  a
> écrit :
>
>> Hi I agree with [email protected] renaming fields and doing
>> migrations is definitely not the most optimal solution. I suggest you have
>> generic names. Anything variable mostly ends up being a field on a table or
>> a table, depending on your use case. I hope you figured that out though?
>>
>> On Wed, Jan 29, 2025 at 11:05 PM Alexei Ramotar 
>> wrote:
>>
>>> I'd just give the columns generic names and let react handle the names
>>> you want to display which is probably based on dates or something cyclical.
>>> Otherwise it seems like too much overhead in renaming fields and migration.
>>>
>>> On Wed, Jan 29, 2025, 2:56 PM 'Ryan Nowakowski' via Django users <
>>> [email protected]> wrote:
>>>

 On 1/27/25 7:41 AM, Mayank Prajapati wrote:
 > I am making a full stack project with JavaScript and react for front
 end , Postgre SQL for database and Django for backend and Django rest
 framework for APIs. So in models.py file there's one field which is to be
 removed and another field is to be added at the end. This process has to be
 done once daily at specific time. For example, assume there are five fields
 in my models i.e. A,B,C,D and E. At some specific time field B will be
 removed and new field E will be added after D, again same process will
 repeat next day field C will be removed and new field F will be added after
 E. I can implement this process through python file handling and "with"
 method.
 >
 > So my question is, should i implement this process in my Django
 project? Will this process work efficiently in production environment?
 >

 When you say "field" are these FileFields <
 https://docs.djangoproject.com/en/5.1/ref/models/fields/#filefield>?
 And when you say "removed" and "added", are you talking about actually
 removing the field from the model(via migrations <
 https://docs.djangoproject.com/en/5.1/topics/migrations/>) or setting
 that field to "None"(null) when you "remove" it?

 --
 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 [email protected].
 To view this discussion visit
 https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com
 
 .

>>> --
>>> 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 [email protected].
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/django-users/CACCvK-vi3ooiMfKAGpMYyme4c2jA1fxbvY3HD0tdBRn7oc%2Bx%2BQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/CALHJg5%2BPWQXN3Wxnse8LZu%3Dm-1wgZ3S-EpCUk5hajMKR%3DPq3OA%40mail.gmail.com
>> 
>> .
>>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/CA%2BbeU1Oa6-CL%3D4LBkiOVVXE9kEfqsBYQvLwH0dhsXFDD2Vei6w%40mail.gmail.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CA%2BGQzJO8DyBDNJ%2BQcj-pDJ08tKTVoGdFNn0YzM0hM-gNCYOTOQ%40mail.gmail.com.


Re: File handling in Django

2025-02-04 Thread Siddhaarrth S Nayyar
Mayank

I think you should not delete and add  the fields rather make them one
consistent model so that while reporting or may be during data analytics
that will play big role since it’s just date field.

Otherwise changing the model may need migration which is like adding an
extra process

All the best


*Best Regards*

*Sidhaarrth S Nayyar*

R S Infomedia And Films Pvt Ltd. | WZ-79C/6, First floor, Lane no 7A, Main
Bharti College Road, Virender Nagar, Janak Puri, New Delhi – 1100 058,
India.
+91 9811222863 (primary), 8076606202 |  +91 11 25546949 |  | IMDB
 | Linkedin
 | Google Hangout
 | Skype
 | www.rsifpl.com |
www.rsproduction.com | SHOWREEL  |


On Wed, 29 Jan 2025 at 16:06, Mayank Prajapati <
[email protected]> wrote:

> I am making train ticket booking project in which I have to keep record of
> number of tickets booked and remaining seats for 60 days from today. So as
> the day passes , passed date field have to be removed and new date after 59
> days from today has to be added.
>
> On Wed, 29 Jan 2025, 12:24 pm Agar Joshua,  wrote:
>
>> This is an interesting implementation. I am curious, what are you trying
>> to achieve that necessitates adding and removing fields? And wouldnt that
>> be solved better with some table relationship instead?
>>
>> On Tue, Jan 28, 2025 at 1:33 AM Mayank Prajapati <
>> [email protected]> wrote:
>>
>>> I am making a full stack project with JavaScript and react for front end
>>> , Postgre SQL for database and Django for backend and Django rest framework
>>> for APIs. So in models.py file there's one field which is to be removed and
>>> another field is to be added at the end. This process has to be done once
>>> daily at specific time. For example, assume there are five fields in my
>>> models i.e. A,B,C,D and E. At some specific time field B will be removed
>>> and new field E will be added after D, again same process will repeat next
>>> day field C will be removed and new field F will be added after E. I can
>>> implement this process through python file handling and "with" method.
>>>
>>> So my question is, should i implement this process in my Django project?
>>> Will this process work efficiently in production environment?
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/CALHJg5%2BRzLrFE0%3DAro_ByQe3nJixBMLObdfVQNsBoeTsRibLhQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/CAEn_UdWRSHSvBVtvpQ3QfENwbFtX7zA2i2p4z9_ye2vNd4Mqhg%40mail.gmail.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CAN__fS7Msoy7b6%2BkDDGtNPPdJM1iUAnx6gsV-BSrfv5u1HDX8g%40mail.gmail.com.


Re: File handling in Django

2025-02-04 Thread Idohou Sandé Augustin
I'm looking for back end developer Django

Le mar. 4 févr. 2025, 06:03, Agar Joshua  a écrit :

> Hi I agree with [email protected] renaming fields and doing
> migrations is definitely not the most optimal solution. I suggest you have
> generic names. Anything variable mostly ends up being a field on a table or
> a table, depending on your use case. I hope you figured that out though?
>
> On Wed, Jan 29, 2025 at 11:05 PM Alexei Ramotar 
> wrote:
>
>> I'd just give the columns generic names and let react handle the names
>> you want to display which is probably based on dates or something cyclical.
>> Otherwise it seems like too much overhead in renaming fields and migration.
>>
>> On Wed, Jan 29, 2025, 2:56 PM 'Ryan Nowakowski' via Django users <
>> [email protected]> wrote:
>>
>>>
>>> On 1/27/25 7:41 AM, Mayank Prajapati wrote:
>>> > I am making a full stack project with JavaScript and react for front
>>> end , Postgre SQL for database and Django for backend and Django rest
>>> framework for APIs. So in models.py file there's one field which is to be
>>> removed and another field is to be added at the end. This process has to be
>>> done once daily at specific time. For example, assume there are five fields
>>> in my models i.e. A,B,C,D and E. At some specific time field B will be
>>> removed and new field E will be added after D, again same process will
>>> repeat next day field C will be removed and new field F will be added after
>>> E. I can implement this process through python file handling and "with"
>>> method.
>>> >
>>> > So my question is, should i implement this process in my Django
>>> project? Will this process work efficiently in production environment?
>>> >
>>>
>>> When you say "field" are these FileFields <
>>> https://docs.djangoproject.com/en/5.1/ref/models/fields/#filefield>?
>>> And when you say "removed" and "added", are you talking about actually
>>> removing the field from the model(via migrations <
>>> https://docs.djangoproject.com/en/5.1/topics/migrations/>) or setting
>>> that field to "None"(null) when you "remove" it?
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com
>>> 
>>> .
>>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/CACCvK-vi3ooiMfKAGpMYyme4c2jA1fxbvY3HD0tdBRn7oc%2Bx%2BQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/CALHJg5%2BPWQXN3Wxnse8LZu%3Dm-1wgZ3S-EpCUk5hajMKR%3DPq3OA%40mail.gmail.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CA%2BbeU1Oa6-CL%3D4LBkiOVVXE9kEfqsBYQvLwH0dhsXFDD2Vei6w%40mail.gmail.com.


Re: File handling in Django

2025-02-04 Thread Van Kamanga
Implémenter un processus de modification quotidienne des champs de modèle
dans un projet Django peut être complexe, mais c'est faisable. Voici
quelques points à considérer pour garantir que le processus fonctionne
efficacement dans un environnement de production :

✅Planification des tâches:
Pour automatiser la suppression et l'ajout de champs à une heure précise
chaque jour, vous pouvez utiliser un planificateur de tâches comme
**Celery** avec Django. Celery vous permet de gérer les tâches périodiques
de manière efficace. Vous pouvez également utiliser **Django-cron** pour
exécuter des tâches planifiées.

✅Gestion des migrations
Chaque fois que vous modifiez un modèle Django, vous devez créer et
appliquer des migrations pour mettre à jour la base de données. Vous pouvez
automatiser ce processus en utilisant des scripts qui exécutent les
commandes `makemigrations` et `migrate` de Django.

### Exemple de script pour les migrations
Voici un script de ce que j'avais utilisé  dans mon application des
migrations :
```python
import os
import django
from django.core.management import call_command
from datetime import datetime

# Configurer Django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mon_projet.settings')
django.setup()

# Fonction pour mettre à jour les modèles
def update_models():
# Supprimer le champ B
call_command('makemigrations', 'mon_app', name='remove_field_b')
call_command('migrate', 'mon_app')

# Ajouter le nouveau champ E
call_command('makemigrations', 'mon_app', name='add_field_e')
call_command('migrate', 'mon_app')

# Planifier l'exécution quotidienne
if datetime.now().hour == 2:  # Remplacez 2 par l'heure souhaitée
update_models()
```

Le mar. 4 févr. 2025, 06:03, Agar Joshua  a écrit :

> Hi I agree with [email protected] renaming fields and doing
> migrations is definitely not the most optimal solution. I suggest you have
> generic names. Anything variable mostly ends up being a field on a table or
> a table, depending on your use case. I hope you figured that out though?
>
> On Wed, Jan 29, 2025 at 11:05 PM Alexei Ramotar 
> wrote:
>
>> I'd just give the columns generic names and let react handle the names
>> you want to display which is probably based on dates or something cyclical.
>> Otherwise it seems like too much overhead in renaming fields and migration.
>>
>> On Wed, Jan 29, 2025, 2:56 PM 'Ryan Nowakowski' via Django users <
>> [email protected]> wrote:
>>
>>>
>>> On 1/27/25 7:41 AM, Mayank Prajapati wrote:
>>> > I am making a full stack project with JavaScript and react for front
>>> end , Postgre SQL for database and Django for backend and Django rest
>>> framework for APIs. So in models.py file there's one field which is to be
>>> removed and another field is to be added at the end. This process has to be
>>> done once daily at specific time. For example, assume there are five fields
>>> in my models i.e. A,B,C,D and E. At some specific time field B will be
>>> removed and new field E will be added after D, again same process will
>>> repeat next day field C will be removed and new field F will be added after
>>> E. I can implement this process through python file handling and "with"
>>> method.
>>> >
>>> > So my question is, should i implement this process in my Django
>>> project? Will this process work efficiently in production environment?
>>> >
>>>
>>> When you say "field" are these FileFields <
>>> https://docs.djangoproject.com/en/5.1/ref/models/fields/#filefield>?
>>> And when you say "removed" and "added", are you talking about actually
>>> removing the field from the model(via migrations <
>>> https://docs.djangoproject.com/en/5.1/topics/migrations/>) or setting
>>> that field to "None"(null) when you "remove" it?
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com
>>> 
>>> .
>>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/CACCvK-vi3ooiMfKAGpMYyme4c2jA1fxbvY3HD0tdBRn7oc%2Bx%2BQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from thi

Re: File handling in Django

2025-02-03 Thread Agar Joshua
Hi I agree with [email protected] renaming fields and doing
migrations is definitely not the most optimal solution. I suggest you have
generic names. Anything variable mostly ends up being a field on a table or
a table, depending on your use case. I hope you figured that out though?

On Wed, Jan 29, 2025 at 11:05 PM Alexei Ramotar 
wrote:

> I'd just give the columns generic names and let react handle the names you
> want to display which is probably based on dates or something cyclical.
> Otherwise it seems like too much overhead in renaming fields and migration.
>
> On Wed, Jan 29, 2025, 2:56 PM 'Ryan Nowakowski' via Django users <
> [email protected]> wrote:
>
>>
>> On 1/27/25 7:41 AM, Mayank Prajapati wrote:
>> > I am making a full stack project with JavaScript and react for front
>> end , Postgre SQL for database and Django for backend and Django rest
>> framework for APIs. So in models.py file there's one field which is to be
>> removed and another field is to be added at the end. This process has to be
>> done once daily at specific time. For example, assume there are five fields
>> in my models i.e. A,B,C,D and E. At some specific time field B will be
>> removed and new field E will be added after D, again same process will
>> repeat next day field C will be removed and new field F will be added after
>> E. I can implement this process through python file handling and "with"
>> method.
>> >
>> > So my question is, should i implement this process in my Django
>> project? Will this process work efficiently in production environment?
>> >
>>
>> When you say "field" are these FileFields <
>> https://docs.djangoproject.com/en/5.1/ref/models/fields/#filefield>? And
>> when you say "removed" and "added", are you talking about actually removing
>> the field from the model(via migrations <
>> https://docs.djangoproject.com/en/5.1/topics/migrations/>) or setting
>> that field to "None"(null) when you "remove" it?
>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com
>> 
>> .
>>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/CACCvK-vi3ooiMfKAGpMYyme4c2jA1fxbvY3HD0tdBRn7oc%2Bx%2BQ%40mail.gmail.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CALHJg5%2BPWQXN3Wxnse8LZu%3Dm-1wgZ3S-EpCUk5hajMKR%3DPq3OA%40mail.gmail.com.


RE: File handling in Django

2025-01-30 Thread Johannes Grib
Hi, When changing the model, you will need to migrate.

Rather update the past_date field with the newdate etc..

 

 

Johannes

 

 

From: [email protected]  On Behalf 
Of Mayank Prajapati
Sent: Wednesday, January 29, 2025 12:34 PM
To: [email protected]
Subject: Re: File handling in Django

 

I am making train ticket booking project in which I have to keep record of 
number of tickets booked and remaining seats for 60 days from today. So as the 
day passes , passed date field have to be removed and new date after 59 days 
from today has to be added.

 

On Wed, 29 Jan 2025, 12:24 pm Agar Joshua, mailto:[email protected]> > wrote:

This is an interesting implementation. I am curious, what are you trying to 
achieve that necessitates adding and removing fields? And wouldnt that be 
solved better with some table relationship instead?

 

On Tue, Jan 28, 2025 at 1:33 AM Mayank Prajapati mailto:[email protected]> > wrote:

I am making a full stack project with JavaScript and react for front end , 
Postgre SQL for database and Django for backend and Django rest framework for 
APIs. So in models.py file there's one field which is to be removed and another 
field is to be added at the end. This process has to be done once daily at 
specific time. For example, assume there are five fields in my models i.e. 
A,B,C,D and E. At some specific time field B will be removed and new field E 
will be added after D, again same process will repeat next day field C will be 
removed and new field F will be added after E. I can implement this process 
through python file handling and "with" method. 

 

So my question is, should i implement this process in my Django project? Will 
this process work efficiently in production environment?

-- 
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 [email protected] 
<mailto:[email protected]> .
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com
 
<https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
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 [email protected] 
<mailto:[email protected]> .
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CALHJg5%2BRzLrFE0%3DAro_ByQe3nJixBMLObdfVQNsBoeTsRibLhQ%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CALHJg5%2BRzLrFE0%3DAro_ByQe3nJixBMLObdfVQNsBoeTsRibLhQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
 .

-- 
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 [email protected] 
<mailto:[email protected]> .
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CAEn_UdWRSHSvBVtvpQ3QfENwbFtX7zA2i2p4z9_ye2vNd4Mqhg%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CAEn_UdWRSHSvBVtvpQ3QfENwbFtX7zA2i2p4z9_ye2vNd4Mqhg%40mail.gmail.com?utm_medium=email&utm_source=footer>
 .



-- 
This email has been checked for viruses by AVG antivirus software.
www.avg.com

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/001f01db725e%2406e20690%2414a613b0%24%40gmail.com.


Re: File handling in Django

2025-01-29 Thread Alexei Ramotar
I'd just give the columns generic names and let react handle the names you
want to display which is probably based on dates or something cyclical.
Otherwise it seems like too much overhead in renaming fields and migration.

On Wed, Jan 29, 2025, 2:56 PM 'Ryan Nowakowski' via Django users <
[email protected]> wrote:

>
> On 1/27/25 7:41 AM, Mayank Prajapati wrote:
> > I am making a full stack project with JavaScript and react for front end
> , Postgre SQL for database and Django for backend and Django rest framework
> for APIs. So in models.py file there's one field which is to be removed and
> another field is to be added at the end. This process has to be done once
> daily at specific time. For example, assume there are five fields in my
> models i.e. A,B,C,D and E. At some specific time field B will be removed
> and new field E will be added after D, again same process will repeat next
> day field C will be removed and new field F will be added after E. I can
> implement this process through python file handling and "with" method.
> >
> > So my question is, should i implement this process in my Django project?
> Will this process work efficiently in production environment?
> >
>
> When you say "field" are these FileFields <
> https://docs.djangoproject.com/en/5.1/ref/models/fields/#filefield>? And
> when you say "removed" and "added", are you talking about actually removing
> the field from the model(via migrations <
> https://docs.djangoproject.com/en/5.1/topics/migrations/>) or setting
> that field to "None"(null) when you "remove" it?
>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CACCvK-vi3ooiMfKAGpMYyme4c2jA1fxbvY3HD0tdBRn7oc%2Bx%2BQ%40mail.gmail.com.


Re: File handling in Django

2025-01-29 Thread 'Ryan Nowakowski' via Django users

On 1/27/25 7:41 AM, Mayank Prajapati wrote:
> I am making a full stack project with JavaScript and react for front end , 
> Postgre SQL for database and Django for backend and Django rest framework for 
> APIs. So in models.py file there's one field which is to be removed and 
> another field is to be added at the end. This process has to be done once 
> daily at specific time. For example, assume there are five fields in my 
> models i.e. A,B,C,D and E. At some specific time field B will be removed and 
> new field E will be added after D, again same process will repeat next day 
> field C will be removed and new field F will be added after E. I can 
> implement this process through python file handling and "with" method.
> 
> So my question is, should i implement this process in my Django project? Will 
> this process work efficiently in production environment?
> 

When you say "field" are these FileFields 
? And when 
you say "removed" and "added", are you talking about actually removing the 
field from the model(via migrations 
) or setting that 
field to "None"(null) when you "remove" it?

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/B1F2C8F6-766A-4515-ADEC-C72D59866E71%40fattuba.com.


Re: File handling in Django

2025-01-29 Thread Mayank Prajapati
I am making train ticket booking project in which I have to keep record of
number of tickets booked and remaining seats for 60 days from today. So as
the day passes , passed date field have to be removed and new date after 59
days from today has to be added.

On Wed, 29 Jan 2025, 12:24 pm Agar Joshua,  wrote:

> This is an interesting implementation. I am curious, what are you trying
> to achieve that necessitates adding and removing fields? And wouldnt that
> be solved better with some table relationship instead?
>
> On Tue, Jan 28, 2025 at 1:33 AM Mayank Prajapati <
> [email protected]> wrote:
>
>> I am making a full stack project with JavaScript and react for front end
>> , Postgre SQL for database and Django for backend and Django rest framework
>> for APIs. So in models.py file there's one field which is to be removed and
>> another field is to be added at the end. This process has to be done once
>> daily at specific time. For example, assume there are five fields in my
>> models i.e. A,B,C,D and E. At some specific time field B will be removed
>> and new field E will be added after D, again same process will repeat next
>> day field C will be removed and new field F will be added after E. I can
>> implement this process through python file handling and "with" method.
>>
>> So my question is, should i implement this process in my Django project?
>> Will this process work efficiently in production environment?
>>
>> --
>> 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 [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com
>> 
>> .
>>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/CALHJg5%2BRzLrFE0%3DAro_ByQe3nJixBMLObdfVQNsBoeTsRibLhQ%40mail.gmail.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CAEn_UdWRSHSvBVtvpQ3QfENwbFtX7zA2i2p4z9_ye2vNd4Mqhg%40mail.gmail.com.


Re: File handling in Django

2025-01-28 Thread Agar Joshua
This is an interesting implementation. I am curious, what are you trying to
achieve that necessitates adding and removing fields? And wouldnt that be
solved better with some table relationship instead?

On Tue, Jan 28, 2025 at 1:33 AM Mayank Prajapati <
[email protected]> wrote:

> I am making a full stack project with JavaScript and react for front end ,
> Postgre SQL for database and Django for backend and Django rest framework
> for APIs. So in models.py file there's one field which is to be removed and
> another field is to be added at the end. This process has to be done once
> daily at specific time. For example, assume there are five fields in my
> models i.e. A,B,C,D and E. At some specific time field B will be removed
> and new field E will be added after D, again same process will repeat next
> day field C will be removed and new field F will be added after E. I can
> implement this process through python file handling and "with" method.
>
> So my question is, should i implement this process in my Django project?
> Will this process work efficiently in production environment?
>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CALHJg5%2BRzLrFE0%3DAro_ByQe3nJixBMLObdfVQNsBoeTsRibLhQ%40mail.gmail.com.


Re: File handling in Django

2025-01-27 Thread Otecina
It will work normally, go ahead.

On Mon, Jan 27, 2025, 11:33 PM Mayank Prajapati <
[email protected]> wrote:

> I am making a full stack project with JavaScript and react for front end ,
> Postgre SQL for database and Django for backend and Django rest framework
> for APIs. So in models.py file there's one field which is to be removed and
> another field is to be added at the end. This process has to be done once
> daily at specific time. For example, assume there are five fields in my
> models i.e. A,B,C,D and E. At some specific time field B will be removed
> and new field E will be added after D, again same process will repeat next
> day field C will be removed and new field F will be added after E. I can
> implement this process through python file handling and "with" method.
>
> So my question is, should i implement this process in my Django project?
> Will this process work efficiently in production environment?
>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/75091646-157a-4b2e-8aa0-0c05b2d50b0fn%40googlegroups.com
> 
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CANdWVZZRL3ZfBqSW2yOCSB4xExVd_zAwfV5HjmTRuuiSyEDmCg%40mail.gmail.com.