Rails User management system to django user management system for REST API

2017-11-11 Thread Asif Saifuddin
Hi, I have and existing live project running on rails. I have to expose the API's using django for now. I have generated models and edited them to create django model and mapping and exposed some API locally. I have one issue which is confusing my mind. That is how would I use the existing use

Re: Migration Issues when updating model's default primary key from id to uuid

2017-11-11 Thread Liuyang Wan
Okay, user preference aside. Is this something Django couldn't handle at the moment? If so, it should be submitted as a bug. On Saturday, November 11, 2017 at 10:22:03 PM UTC+8, mike wrote: > > i would never try to fight my database and django like that. I would add a > separate uuid field > >

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread PASCUAL Eric
Hi, Since it is static (i.e. never modified), the CSS classes dictionary (statemap) could be extracted from the function and promoted as a module global variable, to avoid it being reconstructed each time the filter is invoked. This will not cut the processing time in half, but small streams

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread treyd
Omar (and everybody else who responded), Thanks for that ideas and putting a method on the model to return the appropriate CSS class based on the state. I think that would be the cleanest solution if I am going to bite the bullet and put this template-specific logic on the model. It got me th

Re: Callback Function Not running

2017-11-11 Thread yingi keme
No i dont. But i am thinking that since it is a GET http request, Then there shouldnt be a parameter in the url pattern. So maybe it should be url(r'callback/' call_back) instead the previous one i did. Although i havent tried it out yet. Yingi Kem > On 11 Nov 2017, at 4:46 PM, Dylan Reinhold

Re: Callback Function Not running

2017-11-11 Thread Dylan Reinhold
Do you have a url entry above that is also matching it? On Sat, Nov 11, 2017 at 3:52 AM, yingi keme wrote: > I have a callback function(webhook) implemented below > > def call_back(request, param): > # Testnet > method='GET' > x_signature = request.headers.get('X-Signature') > pr

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread Omar Helal
Hi treyd, I think idea of updating the model and storing it in the db is a bit overkill, however you could create an @propery on the model that will do that logic for you and return the css class for you. e.g. @property def css_class(self): if self.state is SUCHANDSUCH: return "label-soan

Re: Migration Issues when updating model's default primary key from id to uuid

2017-11-11 Thread m1chael
i would never try to fight my database and django like that. I would add a separate uuid field On Fri, Nov 10, 2017 at 10:54 PM, Liuyang Wan wrote: > Let's say in my Django project I have two models A and B. > > class A(models.Model): > something... > > class B(models.Model): > a = model

Callback Function Not running

2017-11-11 Thread yingi keme
I have a callback function(webhook) implemented below def call_back(request, param): # Testnet method='GET' x_signature = request.headers.get('X-Signature') print(siri) request_uri_encoded = str(request).splitlines()[0].split()[1] request_uri = urllib.parse.unquote