Re: pass link value in argument for view

2016-05-12 Thread 'Tom Evans' via Django users
On Wed, May 11, 2016 at 3:28 PM, quentin ladrier wrote: > sorry for the delay . I obtain this kind of error message: > NoReverseMatch at /my_views/my_arg/ . Reverse for 'xxx' with arguments > '(my_arg,)' and keyword arguments '{}' not found. 1 pattern(s) tried: >

Re: pass link value in argument for view

2016-05-12 Thread quentin ladrier
so I have test with an S+ or * and finally I obtain same error message. this my first django project regards quentin Le jeudi 12 mai 2016 11:27:21 UTC+2, Tom Evans a écrit : > > On Wed, May 11, 2016 at 3:28 PM, quentin ladrier > wrote: > > sorry for the delay . I

Re: Need Django open-source project for Classifieds website.

2016-05-12 Thread Wahid Rezgui
> > hy , did you find any way to build classified website using django , if you have any idea please tell me best regards wahid rezgui > . -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: How to atomically create and lock an object?

2016-05-12 Thread Carsten Fuchs
Hi Simon, many thanks for your reply! Please see below for some follow-up questions. Am 11.05.2016 um 16:04 schrieb Simon Charette: Did you try using select_for_update() with get_or_create()[1] in an atomic()[2] context? @transation.atomic def demonstrate_the_problem(): d = date.today()

Re: pass link value in argument for view

2016-05-12 Thread C. Kirby
use \w+ to capture characters and digits. Also general django practice is to end all urls with a slash so: url(r'^myapp/(?P\w+)/$', views.my_view) On Thursday, May 12, 2016 at 4:32:20 AM UTC-5, quentin ladrier wrote: > > so I have test with an S+ or * and finally I obtain same error message. >

Re: How to atomically create and lock an object?

2016-05-12 Thread Simon Charette
Hi Carsten, > Why will the other thread block? > (Both threads may enter the "create" case, so the select_for_update() may not > yet be effective for the other thread?) > I looked into get_or_create()'s source code and the _create_object_from_params() > method that it calls. Is this due to the

1.8 or 1.9?

2016-05-12 Thread Ankush Thakur
I want to take a Udemy course on Django because it shows how to make an e-commerce website. The only catch - it follows Django 1.8. So my question is: Will I be "wasting" my time learning a possibly outdated (or unrecommended) version of Django? I have a feeling the changes aren't going to be that

Re: How to atomically create and lock an object?

2016-05-12 Thread Carsten Fuchs
Hi Simon, that's awesome! This problem has been bothering me for a long time because I never quite understood how to get the locking / blocking and the transactions right. Your's was a huge help, thank you very much for it! :-) Best regards, Carsten Am 12.05.2016 um 17:10 schrieb Simon

Re: Best way to switch from mysql to postgres?

2016-05-12 Thread Eugene Gavrish
> the empty postgres is already prepared What do you mean? What about "syncdb" or "migrate" ? Bets regards, Eugene среда, 11 мая 2016 г., 22:17:08 UTC+3 пользователь anton написал: > > hi, > > I have a django (1.8.13) project running > on windows 7 64 bit + python 2.7.10 (32bit). > >

Re: 1.8 or 1.9?

2016-05-12 Thread Sean McKinley
I haven't taken the course, but the differences between basic Django 1.8 and 1.9 are not all that significant and you can find out if you are being taught something odd by reviewing 1.9 release notes. Big caveat, syncdb is gone in 1.9 so you have to learn migrations if the Udemy course is using

Re: 1.8 or 1.9?

2016-05-12 Thread Florian Schweikert
On 12/05/16 18:36, Sean McKinley wrote: > I haven't taken the course, but the differences between basic Django 1.8 > and 1.9 are not all that significant and you can find out if you are > being taught something odd by reviewing 1.9 release notes. Big caveat, > syncdb is gone in 1.9 so you have to

negative float

2016-05-12 Thread Григор Колев
#models.py coef = models.DecimalField(max_digits=5, decimal_places=4, default=0.0100, verbose_name='Коефицент') #view.py item['coef'] == 0.01 print item['coef'] # return 0.0 if item['total'] < 0: item['sum'] = item['total'] * ( item['coef'] * -1) On Python it is work. I try to make coke

Delete all migration files

2016-05-12 Thread Noumia Ngangoum
Hi, is there a way to delete all migrations history , i.e. from the database and also from the apps ? -- 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

Re: negative float

2016-05-12 Thread Sergiy Khohlov
Hard to help with this small code. Could you please send me all function or class from your view.py ? 12 трав. 2016 22:37 "Григор Колев" пише: > #models.py > coef = models.DecimalField(max_digits=5, decimal_places=4, default=0.0100, > verbose_name='Коефицент') > > >

Re: negative float

2016-05-12 Thread Григор Колев
I found the error. coef is taken from another database The two fields are the same but when I record value in the new database is not recorded properly. this is the solution but no sense. The fields in both databases are identical. I just copy from one database and paste the value in the other

Re: Fixtures won't load twice in same testcase

2016-05-12 Thread Rich Rauenzahn
On Thursday, May 5, 2016 at 4:22:11 PM UTC-7, Mike Dewhirst wrote: > > Are you using setUp() and tearDown() as class methods in your test class? > > No, the code was using setUpClass(), which is a classmethod. -- You received this message because you are subscribed to the Google Groups

Re: Fixtures won't load twice in same testcase

2016-05-12 Thread Rich Rauenzahn
On Friday, May 6, 2016 at 4:11:42 AM UTC-7, Alasdair Nicol wrote: > > >> >> But In this particular run I'm currently tracing, rich is already in the >> db (as the only entry) as pk=5 (via fixture loading process). For one, >> this tells me the sequence generators aren't always resetting

Re: Delete all migration files

2016-05-12 Thread Eugene Gavrish
Hi, 1) truncate django_migrations table 2) cleanup migration folders in your apps Best regards, Eugene четверг, 12 мая 2016 г., 23:05:56 UTC+3 пользователь Noumia Ngangoum написал: > > Hi, > is there a way to delete all migrations history , i.e. from the database > and also from the apps ?

Re: installation steps for django and virtualenv setup.

2016-05-12 Thread Sean McKinley
Download Python of choice. Pip install virtualenv. Pip install Django. Use google. On Thursday, April 7, 2016 at 8:28:53 AM UTC-7, srinivas tummalapalli wrote: > > Hi santosh,i installed oracle VM virtual box and linux mint, can send the > installation steps for django and virtualenv setup. >

django.contrib apps migrations

2016-05-12 Thread Sean McKinley
Django 1.7+ noob here. Are you supposed to to track the migrations performed within the django.contrib apps? How do you deploy to production on a different machine without grabbing these migrations from the django installation? -- You received this message because you are subscribed to the

Re: 1.8 or 1.9?

2016-05-12 Thread dk
will be better to hit your head vs the wall now using 1.9, than later in a real project,plus there is not much difference, they added a couple of things, but mostly is the same, I would do the Django tutorial of Django website before, step by step. On Thursday, May 12, 2016 at 8:55:15

Django custom auth_user_model error

2016-05-12 Thread Dave N
I've been trying to customize a django auth_user_model, and it has led me to the latest error/issue, which can be found here: http://stackoverflow.com/questions/37197771/django-attributeerror-usermanager-object-has-no-attribute-create-superuser Please help get me out of Django config hell, so I

Image Upload

2016-05-12 Thread Jagdeep Sidhu
In this i am getting the message "Image added successfully" but it not going in the database #models.py class Image(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='images_created') title = models.CharField(max_length=200) slug =

Re: Image Upload

2016-05-12 Thread Nikolas Stevenson-Molnar
Try removing this line: new_item.image = request.FILES['image’] That should already be handled for you by the form. > On May 12, 2016, at 6:30 PM, Jagdeep Sidhu wrote: > > In this i am getting the message "Image added successfully" but it not going > in the database >

Re: Delete all migration files

2016-05-12 Thread Noumia Ngangoum
Yeah Eugene, I know that, that's how I do now. I was looking for a one-liner command or something. On Thursday, May 12, 2016 at 7:02:07 PM UTC-4, Eugene Gavrish wrote: > > Hi, > 1) truncate django_migrations table > 2) cleanup migration folders in your apps > > > > Best regards, > Eugene > >

Re: how to use css in django 1.9

2016-05-12 Thread dk
or what would be the best way to "print" the path for static? On Thursday, May 12, 2016 at 5:03:45 PM UTC-7, dk wrote: > I am starting with Django 1.9 and it say that we can have static files > outside the apps, just for generics for the hole project or inside the > apps. > > according

Re: Delete all migration files

2016-05-12 Thread Michal Petrucha
On Thu, May 12, 2016 at 08:11:42PM -0700, Noumia Ngangoum wrote: > Yeah Eugene, I know that, that's how I do now. > I was looking for a one-liner command or something. There is no one-liner, because you are not supposed to remove all migrations. The entire point of migrations is that once you

Re: django.contrib apps migrations

2016-05-12 Thread Michal Petrucha
On Thu, May 12, 2016 at 04:55:46PM -0700, Sean McKinley wrote: > Django 1.7+ noob here. Are you supposed to to track the migrations > performed within the django.contrib apps? How do you deploy to production > on a different machine without grabbing these migrations from the django >