Re: Set two fields to the same value
you could only assign a Field variable in the Model, "time" absolutely not a Field, the error appears. -- luthur On Thursday, July 12, 2012 at 9:51 PM, Jaroslav Dobrek wrote: > Hello, > > how can I design a model such that two fields are set to the same value when > a new object of the type defined by the model is created? > > Example: > > class Test(models.Model): > start_time = models.DateTimeField() > end_time = models.DateTimeField() > time = start_time > > > Users may create Test objects in order to run their own tests. A test always > starts at some date time and it always ends at some date time. Each test has > a time which is increased until it equals the end time. When a user creates a > new test (and before he uses it) the field time should have the same value as > the field start_time. > > The code above will produce a database error. > > Jaroslav > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/ekl9tv3zHTIJ. > To post to this group, send email to django-users@googlegroups.com > (mailto:django-users@googlegroups.com). > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > (mailto:django-users+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Error in blog
why not post your example? It's too abstract. -- luthur On Thursday, July 12, 2012 at 9:56 PM, jun wrote: > > > On Thursday, July 12, 2012 7:40:46 PM UTC+8, lawgon wrote: > > On Wed, 2012-07-11 at 23:29 -0700, jun wrote: > > > I was trying out the blog example in Django by Example but ran into > > > this error: > > > Reverse for 'blog_post_add' with arguments '()' and keyword arguments > > > '{}' not found. > > > > > > I think it has something to do with the urlpatterns since there is > > > no /blog/post/add configuration there, and tried a few variations but > > > nothing worked. > > > > > > What should I do next? Any django docs I can refer to, as in how to > > > link the blog_post_add with the main url? > > > > what version of django are you using - is it the same version that is > > being used in the example? > > -- > > regards > > Kenneth Gonsalves > > > Hi I'm using Django 1.4 now. Understand that the example is using 1.2. Would > this have an effect? > > Regards, > jun > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/Ox4KIBiwce8J. > To post to this group, send email to django-users@googlegroups.com > (mailto:django-users@googlegroups.com). > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > (mailto:django-users+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Error in blog
i think you probably could visit http://stackoverflow.com/questions/625047/django-newbie-reverse-not-found for solution -- luthur On Thursday, July 12, 2012 at 11:30 PM, Tomas Neme wrote: > Have you done the django tutorial, first? it covers named urls > > On Thu, Jul 12, 2012 at 11:06 AM, luthur (mailto:kongpo0...@gmail.com)> wrote: > > why not post your example? It's too abstract. > > > > -- > > luthur > > > > On Thursday, July 12, 2012 at 9:56 PM, jun wrote: > > > > > > > > On Thursday, July 12, 2012 7:40:46 PM UTC+8, lawgon wrote: > > > > On Wed, 2012-07-11 at 23:29 -0700, jun wrote: > > > I was trying out the blog example in Django by Example but ran into > > > this error: > > > Reverse for 'blog_post_add' with arguments '()' and keyword arguments '{}' > > > not found. > > > > > > I think it has something to do with the urlpatterns since there is > > > no /blog/post/add configuration there, and tried a few variations but > > > nothing worked. > > > > > > What should I do next? Any django docs I can refer to, as in how to > > > link the blog_post_add with the main url? > > > > > > > > > what version of django are you using - is it the same version that is > > being used in the example? > > -- > > regards > > Kenneth Gonsalves > > > > Hi I'm using Django 1.4 now. Understand that the example is using 1.2. Would > > this have an effect? > > > > Regards, > > jun > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/django-users/-/Ox4KIBiwce8J. > > To post to this group, send email to django-users@googlegroups.com > > (mailto:django-users@googlegroups.com). > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com > > (mailto:django-users+unsubscr...@googlegroups.com). > > For more options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-users@googlegroups.com > > (mailto:django-users@googlegroups.com). > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com > > (mailto:django-users+unsubscr...@googlegroups.com). > > For more options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > > > > > > > -- > "The whole of Japan is pure invention. There is no such country, there > are no such people" --Oscar Wilde > > |_|0|_| > |_|_|0| > |0|0|0| > > (\__/) > (='.'=)This is Bunny. Copy and paste bunny > (")_(") to help him gain world domination. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com > (mailto:django-users@googlegroups.com). > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > (mailto:django-users+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.