Re: function to create objects in a given model
Thanks a lot, I'll try that. Hélène Le mardi 20 mai 2014 20:50:34 UTC+2, Ilya Kazakevich a écrit : > > Hello, > > Try managers: https://docs.djangoproject.com/en/1.6/topics/db/managers/ > > Ilya Kazakevich, > JetBrains PyCharm (Best Python/Django IDE) > http://www.jetbrains.com/pycharm/ > "Develop with pleasure!" > > > >-Original Message- > >From: django...@googlegroups.com > >[mailto:django...@googlegroups.com ] On Behalf Of Chansons > >Sent: Tuesday, May 20, 2014 7:10 PM > >To: django...@googlegroups.com > >Subject: function to create objects in a given model > > > >Hello everybody, > > > >I'm new to django, and writing my first app, I have a question before > deploying it. > > > >I need to have a function that would create or modify, according to a few > rules > >and a precise instance of a model (Song), many instances of another model > >(Words) at once. > >Writing that function is easy, my problem is, where should I put it, so > it's easy to > >use when the application will be in production? > >Should it be in the model layer? Or in a separate module? Will I call it > with the > >shell? Is it possible to access it via the admin site? Or any other way? > > > >I don't find anything about that in the docs, or in google, any ideas > will be > >welcome. I can be more precise if needed... > >Thanks > > > > > > > > > >-- > >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 post to this group, send email to > >django...@googlegroups.com. > > >Visit this group at http://groups.google.com/group/django-users. > >To view this discussion on the web visit > > > https://groups.google.com/d/msgid/django-users/81d42f98-04da-4e8f-8c0b-3ac > >86601e116%40googlegroups.com > >< > https://groups.google.com/d/msgid/django-users/81d42f98-04da-4e8f-8c0b-3a > >c86601e116%40googlegroups.com?utm_medium=email&utm_source=footer> . > >For more options, visit https://groups.google.com/d/optout. > > > -- 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@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fbe173a8-cfbe-489c-bc56-e767edc914b8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
website statistics
Hello, looking on the web, I didn't find any website statistics script written with python, or django. If some exist, where could I find them, and if not, what do I need to know to write my own? Thanks -- 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@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05358942-a9f3-427c-8550-6ca160900bd9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: function to create objects in a given model
Hello, thanks for your answer, I knew about fixtures, but I'm not sure it's really adapted to what I need. Adding or modifying those instances of a model will depend on a precise instance of another model: when I create a song, I also want to find in the existing glossary / or add the words of the song. I will have to do that often, each time I add a new song. If I use fixture, I would have to modify or create the instances 'outside' the application, and use loaddata afterwards. Isn't there an easier, more direct way to do this? Or perhaps, I didn't quite understand what you meant by that? Le mardi 20 mai 2014 17:32:19 UTC+2, Venkatraman.S. a écrit : > > > https://docs.djangoproject.com/en/dev/howto/initial-data/ > > -V > -- 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@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ffcb89bd-74a4-410b-b886-884c1cb920c5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
function to create objects in a given model
Hello everybody, I'm new to django, and writing my first app, I have a question before deploying it. I need to have a function that would create or modify, according to a few rules and a precise instance of a model (Song), many instances of another model (Words) at once. Writing that function is easy, my problem is, where should I put it, so it's easy to use when the application will be in production? Should it be in the model layer? Or in a separate module? Will I call it with the shell? Is it possible to access it via the admin site? Or any other way? I don't find anything about that in the docs, or in google, any ideas will be welcome. I can be more precise if needed... Thanks -- 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@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/81d42f98-04da-4e8f-8c0b-3ac86601e116%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.