Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread James Schneider
Try adding a capital P after the ? in your named capture group. Otherwise your capture group does not place its value in the your_email variable as you are expecting: (?P... Check out the Python re module syntax for an explanation: https://docs.python.org/2/library/re.html -James On Thursday

Re: How to trace a page not showing up?

2014-10-10 Thread Helgi Örn Helgason
Thank you Erik and Collin for your replies, of which I yet haven't tried out, perhaps because I don't fully understand them. Like a said; I am a noob in Django/Python. :-/ But I have stumbled upon something that could maybe be of help, a thing called solr seems to be causing some problems. su

Re: How to trace a page not showing up?

2014-10-10 Thread Tom Evans
On Fri, Oct 10, 2014 at 10:45 AM, Helgi Örn Helgason wrote: > > Thank you Erik and Collin for your replies, of which I yet haven't tried > out, perhaps because I don't fully understand them. Like a said; I am a noob > in Django/Python. :-/ > > But I have stumbled upon something that could maybe be

Re: How to trace a page not showing up?

2014-10-10 Thread Helgi Örn Helgason
Thank's Tom, solr is most probably not running. sudo netstat -lpn | grep java gave nothing at all /Helgi On Friday, 10 October 2014 10:34:35 UTC, Tom Evans wrote: > > On Fri, Oct 10, 2014 at 10:45 AM, Helgi Örn Helgason > > wrote: > > > > Thank you Erik and Collin for your replies, of which I

Re: permissions and inlines issues

2014-10-10 Thread Emanuel
Hi Thanks for the answer. The current solution I had it's the one that you sugest. But I still have the problem that on the index admin page shows the application. The scenario is this: A factory have a diary production (A) And every day people produce Articles and to do that they use some Feed

Writing tests for a custom auth

2014-10-10 Thread Valery Melou
Hi everybody. I'm creating a custom auth user model to remove 'first_name' and 'last_name' attributes from the default one and to make the 'email' field required and unique. I would like to know which tests I'm supposed to write to make sure that my model support each feature of the default one.

Question on url routing

2014-10-10 Thread robert brook
If I have 2 urls coded in the file for example url(r'^abc/$', views.abc), url( r'^abc/def/$', views.def), And the first url should be accessible by typing it into the browser. The 2nd url should only be accessible from the application, not by virtue of a user typing it into the browser. How do

Re: Question on url routing

2014-10-10 Thread François Schiettecatte
Hi You could check request.META['HTTP_REFERER'], it should be set if the user clicks on a link and unset if the user entered the url in the address bar. Obviously this is browser dependent. If you really want to be sure I would use a one time url with a uuid which you generate and store to vali

Re: permissions and inlines issues

2014-10-10 Thread Collin Anderson
So the remaining problem is that models are showing up in the admin index page when people don't have permission to them? -- 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

Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread Daniel Roseman
On Friday, 10 October 2014 01:00:29 UTC+1, dk wrote: > > I put the Email that I got from a form into the url (I am using the url as > a variable to store the email) > > and look like this > http://127.0.0.1:8000/polls/vote/thank/a...@b.com/ > > > url: > url(r'^vote/thank/(? #here should be RE ca

Re: Question on url routing

2014-10-10 Thread Collin Anderson
Do you mean ajax-only? def my_view(request): if not request.is_ajax(): return redirect('/a-valid-page/') https://docs.djangoproject.com/en/1.7/ref/request-response/#django.http.HttpRequest.is_ajax -- You received this message because you are subscribed to the Google Groups "Django

Re: Custom Exception Handler not being called

2014-10-10 Thread Daniel Roseman
On Friday, 10 October 2014 03:14:32 UTC+1, Néstor Boscán wrote: > > Hi > > I've created a rest service using the APIView and created my own custom > exception handler. I configured my custom exception handler in my > settings.py file using: > > REST_FRAMEWORK = { > 'EXCEPTION_HANDLER': 'modul

Re: Question on url routing

2014-10-10 Thread robert brook
I know how to detect an ajax request. I am interested int the general issue of the user typing in a valid url for the application, but not appropriate for the particular workflow. I utilize the @login_required decorater. I am looking for an analgous function to pass the user back to an approp

Re: Question on url routing

2014-10-10 Thread Vijay Khemlani
I think in those cases you would need to add some custom logic to your view to check whether the URL is valid for the "step" the user is in the workflow. On Fri, Oct 10, 2014 at 10:47 AM, robert brook wrote: > I know how to detect an ajax request. > > I am interested int the general issue of the

Re: Question on url routing

2014-10-10 Thread robert brook
It would seem that this should be a common issue for any web site. based on the DRY principle, how has this been resolved by other developers On Friday, October 10, 2014 8:09:12 AM UTC-4, robert brook wrote: > > If I have 2 urls coded in the file for example > > url(r'^abc/$', views.abc), > url(

Re: permissions and inlines issues

2014-10-10 Thread Emanuel
Yes. But they have permission to them. But I want some people only have permission to see when the models are inlines from another model. And other people have permission to see always... Thanks Sexta-feira, 10 de Outubro de 2014 13:22:35 UTC+1, Collin Anderson escreveu: > > So the remaining pr

Re: permissions and inlines issues

2014-10-10 Thread Collin Anderson
Ohh. Yes. I get it now. At my work we've used the undocumented, unsupported ModelAdmin.get_model_perms() to hide models from the index page. http://stackoverflow.com/questions/2431727/django-admin-hide-a-model -- You received this message because you are subscribed to the Google Groups "Django

Re: permissions and inlines issues

2014-10-10 Thread Collin Anderson
Ohh, but it might still be possible to circumvent that hiding, so I'm not sure. -- 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 django-users+unsubscr...@googleg

Re: permissions and inlines issues

2014-10-10 Thread Emanuel
Ok Thanks, I will try and post here the result later Sexta-feira, 10 de Outubro de 2014 18:45:46 UTC+1, Collin Anderson escreveu: > > Ohh, but it might still be possible to circumvent that hiding, so I'm not > sure. > -- You received this message because you are subscribed to the Google Group

Best approach to adding user notification and message alerts

2014-10-10 Thread Chris BB
I am working on a project that requires the system to show notifications and new message alerts to users when logged in (please see attached image). Whats the best approach to getting this done, what would the code look like - all suggestions are welcomed. Thanks in Advance. -- You received

How to get user ID and ID of newly created record in a CreateView?

2014-10-10 Thread Daniel Grace
Hi, I am using a CreateView. I want to create some related data on a table ("Log" model), so I need the ID of the record being created for the related field (see "flow" below). Also I need the ID of the user creating the record. Something like the following: from django.utils import timezone

Re: permissions and inlines issues

2014-10-10 Thread Emanuel
Thanks, it worked. The final code : models.py class BFlow(models.Model): ... class Meta: permissions = (("see_BFlow", "User can see BFlow in admin index page"),) admin.py class BFlowAdmin(admin.ModelAdmin): def get_model_perms(self, request): if request.user.has_perm('see_BFlow'):

Re: How to get user ID and ID of newly created record in a CreateView?

2014-10-10 Thread Daniel Roseman
On Friday, 10 October 2014 19:03:49 UTC+1, Daniel Grace wrote: > > Hi, I am using a CreateView. I want to create some related data on a > table ("Log" model), so I need the ID of the record being created for the > related field (see "flow" below). Also I need the ID of the user creating > the

Filter queryset later on in a celery task

2014-10-10 Thread Rakan Alhneiti
Hello all, I am currently working on a push notifications library for Django (https://github.com/rakanalh/django-pushy). The current implementation provides the ability to send a push notification to all registered device keys (Android and iOS). The current use-case for the library is doing t

Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread dk
WOW SUPER EASY I been fighting to the get the email and passing it thanks for the tips, and how to use it. my url url(r'^vote/thank/$', views.thank), my views def vote(request): if request.method == "POST": form = polls.forms_DK.NameForm(request.POST) if form.is_valid(

django language tag

2014-10-10 Thread 6233114 6233114
I have some javascript that displays the timespan between two dates according to a language code. For example in en / English: (3 years, 2 months) , in ru / Russian (3 лет, 2 месяцев) in de / German: (3 Jahre, 2 Monate) , etc. The code is working ok but will be difficult to maintain, so I have

Re: Writing tests for a custom auth

2014-10-10 Thread Russell Keith-Magee
Hi Valery, We don't currently ship an integration test to validate your custom User model, for two reasons: 1) The requirements for a User model depends on what features you're using - the core requirements are listed in the docs, but depending on exactly what you're doing with the User model, t

Re: Best approach to adding user notification and message alerts

2014-10-10 Thread Russell Keith-Magee
Hi Chris, As with all interesting questions, the answer is "it depends" :-) At the core, all you need to render badges like the ones you've highlighted is a way to count the "things" that are being displayed (messages, notifications, chickens crossing the road - it doesn't matter). Pass that numb

Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread Javier Guerra Giraldez
On Fri, Oct 10, 2014 at 6:21 PM, dk wrote: > I been fighting to the get the email and passing it if you want to keep a value from one request to another, check the Session feature. In short, it works (almost) like a persistent dictionary private for each web user. -- Javier -- You received