hello i have made my crud and it works well. but when i add fields in the class. the crud does not work

34 views
Skip to first unread message

Abdoulaye SENE

unread,
Aug 10, 2023, 1:11:37 PM8/10/23
to Django users
class Administratif(models.Model):
    nom = models.CharField(max_length=250)
    prenom = models.CharField(max_length=250)
    email = models.EmailField(max_length=250)
    tel = models.IntegerField()
    annEmploi = models.IntegerField(null=True,)

    def __str__(self):
        return self.nom

Kasper Laudrup

unread,
Aug 10, 2023, 3:05:01 PM8/10/23
to django...@googlegroups.com
If it works when you don't add fields to the class, then don't add
fields to the class.

That way it will continue to work and will not stop to work.

I assume you prefer it work instead of not working?

Kind regards,
Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature.asc

Abdoulaye SENE

unread,
Aug 10, 2023, 5:08:51 PM8/10/23
to django...@googlegroups.com
i have to add fields to my class. because i have other fields.normal this problem has a solution


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4179188c-96c0-4725-906c-01112c3ecf57%40stacktrace.dk.

Kasper Laudrup

unread,
Aug 10, 2023, 6:49:44 PM8/10/23
to django...@googlegroups.com
On 10/08/2023 23.07, Abdoulaye SENE wrote:
> i have to add fields to my class. because i have other fields.normal
> this problem has a solution
>

If this problem has a normal solution, have you considered using that
solution?

I don't understand why you're looking for an abnormal solution if the
normal solution will work just fine.

That is, of course, assuming that you want things to work. Maybe that's
not the case?

Kind regards,
Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature.asc

Modou Aicha Diop

unread,
Aug 11, 2023, 9:00:56 AM8/11/23
to django...@googlegroups.com
Try to delete the files that are in the migrations directory of your app and do the migrations again
--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages