How to use multiple ForeignKeys

2018-07-30 Thread Alexander Joseph
I'm building a Purchase Order app that uses a ForeignKey for Vendors. I want to be able to use another ForeignKey for invoices once a Vendor is selected. So the choices of Invoices would get filtered based on the users selection of the Vendor. How would I do this in the model? I assume I'd need

Re: Django tests and token timeout

2018-07-30 Thread Birger Schacht
Hi! On 07/30/2018 05:04 PM, Kasper Laudrup wrote: > Hi Birger, > > On 2018-07-30 16:12, Birger Schacht wrote: >> i'm using my own PasswordResetTokenGenerator which has a timeout that is >> not given in days but hours, to make the password token timeout more >> fine grained. Is there a way to test

Re: Change the default route of a view

2018-07-30 Thread Jason
its not a url, its a http verb. rely on those for API requests. and it would be a user ID for that request. if you're using oauth tokens, that should be handled in your view authenticator, not the view itself -- You received this message because you are subscribed to the Google Groups "Dja

Re: Django tests and token timeout

2018-07-30 Thread Kasper Laudrup
Hi Birger, On 2018-07-30 16:12, Birger Schacht wrote: i'm using my own PasswordResetTokenGenerator which has a timeout that is not given in days but hours, to make the password token timeout more fine grained. Is there a way to test such a timeout in Django tests, i.e. something that lets the un

Re: Django tests and token timeout

2018-07-30 Thread Adam Stein
Whenever I need to set the date or datetime to something specific for unit tests, I use Forbidden Fruit (https://github.com/clarete/forbidden fruit). id="-x-evo-selection-start-marker"> On Mon, 2018-07-30 at 16:12 +0200, Birger Schacht wrote: > hi, > > i'm using my own PasswordResetTokenGenerator

Django tests and token timeout

2018-07-30 Thread Birger Schacht
hi, i'm using my own PasswordResetTokenGenerator which has a timeout that is not given in days but hours, to make the password token timeout more fine grained. Is there a way to test such a timeout in Django tests, i.e. something that lets the unit test use a fake time in the future? cheers, Birg

Re: Change the default route of a view

2018-07-30 Thread Fernando Miranda
Andréas, but in this case what is the PUT url for example, with profile / {id}? And in the id parameter you pass the userid or token of OAuth2? Thank you Em domingo, 29 de julho de 2018 04:50:25 UTC-3, Andréas Kühne escreveu: > > If you are using DRF with normal URLs you just create a view that

Re: [Channels] How to write tests with database access?

2018-07-30 Thread Bill Torcaso
The question is whether testing asynchronous operations and is compatible. In my understanding, Andrew's hint points you in the only good direction. You've got to turn the async initiate/complete cycle back into a synchronous flow. You can poll from another thread, or use a message queue, or

Re: Django App plugins

2018-07-30 Thread Christian González
> > one hack around is to load all the plugins once you create the project > , but make them hidden or unaccessible untill the user want a certain > option-plugin so you make it visible for him This is not possible, as it should be possible to download and install a plugin with one click, and it

Re: Django App plugins

2018-07-30 Thread mottaz hejaze
wow , i faced the [ static and preload problem ] of settings.py once .. you cant govl around it becouse its how they designed django , you cant even pass empty containers for any future values , or will be calculated from the very next script after settings.py , you cant do that , there is no such

Re: Django template cheat sheet or ebook

2018-07-30 Thread mottaz hejaze
i think docs are very good On Mon, 30 Jul 2018, 13:41 , wrote: > Hello, > > I have found a lot of example on the Django's CookBook, at this url : > https://code.djangoproject.com/wiki/CookBook > > Le lundi 30 juillet 2018 05:44:44 UTC+2, aditya a écrit : >> >> Can anyone tell me where I can find

Re: Authentication (Login view)

2018-07-30 Thread mottaz hejaze
in your templates you make a check using {% if request.user.is_authenticated % } content to show {% else %} the login url {% endif %} On Mon, 30 Jul 2018, 13:41 SAD BOIII, wrote: > ?guys, how can i stop logged in users from accessing the log in page again > > >

Re: Authentication (Login view)

2018-07-30 Thread Kasper Laudrup
On 2018-07-30 07:33, SAD BOIII wrote: ?guys, how can i stop logged in users from accessing the log in page again In your view for the login page: if user.is_authenticated(): return HttpResponseForbidden() Or something similar? -- You received this message because you are subscribed to the

Authentication (Login view)

2018-07-30 Thread SAD BOIII
?guys, how can i stop logged in users from accessing the log in page again -- You received this message because you are subscribed to the Google Groups "Djan

Re: Django template cheat sheet or ebook

2018-07-30 Thread Rahul Gurung
search or google or pinterest. On 30 July 2018 at 09:14, aditya gupta wrote: > Can anyone tell me where I can find Django template cheat sheet or ebook. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and

Re: Django template cheat sheet or ebook

2018-07-30 Thread benjamin . bernard-bouissieres
Hello, I have found a lot of example on the Django's CookBook, at this url : https://code.djangoproject.com/wiki/CookBook Le lundi 30 juillet 2018 05:44:44 UTC+2, aditya a écrit : > > Can anyone tell me where I can find Django template cheat sheet or ebook. > -- A quelle Vitesse surfez-vous ?