Re: After changing User.username to PhoneNumberField I can't migrate

2019-11-06 Thread Ahmed Shahwan
was (and I know > this is not a good practice) delete all the migration files and run the > migrations again. > > Then again, If someone knows a better solution... > > Em qua, 6 de nov de 2019 às 09:37, Ahmed Shahwan > escreveu: > >> Hello everybody, >>

Re: Open Source IDE to start with Django Web development

2019-11-06 Thread Ahmed Shahwan
Visual Studio Code is very easy to use and excellent for python. You just need to download the Python language support, django extension and you're good to go. On Wednesday, 6 November 2019 14:38:17 UTC+2, himanshu goyal wrote: > > To Community, > > Greetings! > > Could you suggest a good open s

After changing User.username to PhoneNumberField I can't migrate

2019-11-06 Thread Ahmed Shahwan
Hello everybody, I work on a project started from the cookiecutter-django, and I altered the username of the User model to use `PhoneNumberField` from django-phonenumber-field package instead of the ordinary `models.CharField` and made the necessary changes, then I issued `manage.py makemigrati

Re: Rest framework

2019-08-22 Thread Ahmed Shahwan
you'll just create an endpoint that receives a query parameter with the string to search for, and you'll search using YOURMODEL.objects.get(field=query_params.get("search_str")) the frontend will be responsible for making the requests to search while typing so, in your views.py you'll do someth

Re: Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-22 Thread Ahmed Shahwan
ed”) right after the create() method > > Print(“callback requested”) on top of your callback method > > Which one do you see first ? > > Sent from my iPhone > > On 21 Aug 2019, at 16:56, Ahmed Shahwan > > wrote: > > That's the class, nothing different other

Re: Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-21 Thread Ahmed Shahwan
roperly we can rule >> out this possibility >> >> Its probably a race condition of the callback arriving too soon *before* >> you hit the create() call. So do you know at what point your payment >> gateway will make the callback request and what would trigger it? Make sur

Re: Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-21 Thread Ahmed Shahwan
ility > > Its probably a race condition of the callback arriving too soon *before* > you hit the create() call. So do you know at what point your payment > gateway will make the callback request and what would trigger it? Make sure > you are > > On Wed, Aug 21, 2019 at 4:19 PM Ahmed

Re: Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-21 Thread Ahmed Shahwan
quest()` > > before creating the WeacceptTransaction object. > > Maybe this line needs to move below: > `models.WeAcceptTransaction.objects.create(...)` ? > > At what point is the callback request triggered ? > > On Wed, Aug 21, 2019 at 3:36 PM Ahmed Shahwan

Re: Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-21 Thread Ahmed Shahwan
email], fail_silently=False, ) except Exception as ex: print(">>>>>>>>>>FAILED TO SEND MAIL") print(ex) return Response({"message": "Transaction Updated!"}, status=status. H

Weird Database behavior (Can't access object from a view after directly saving it from inside another view)

2019-08-21 Thread Ahmed Shahwan
Hi, I have a very strange problem that I don't know why it happens. I'm creating a REST API service that wraps another REST API payment service, let's call the other services XPAY. It has various payment options (Card, eWallet, Kiosk, and Cash). The steps required to use the services (to make a