Re: Allow users to submit django form once per day

2015-07-29 Thread Nkansah Rexford
Okay guys,

After some days of thinking about the problem, I'm through with this 
approach, which is totally horrible, I guess, but works.

The code snippet can be found 
here: https://gist.github.com/seanmavley/c9a4af36c2693d9b437a

I'm posting back here because although the approach works, its not 
'sustainable' nor reusable easily. Plus, if someone could guide me (this 
time, code-wise) to do a better job with it, I'll really appreciate. FBV or 
CBV, i'm all ears.

I'm currently using the approach in the link above on 
http://logecg.khophi.co

thanks

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d3d8c5b-117c-4c88-b696-97a62650c2d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Want to change template based on full_name(request.user.username)

2015-07-29 Thread Alex Heyden
{{user}} is implicitly sent in the request, so it might be worth trying to
sort out what specifically went wrong when you say
{{user.is_authenticated}} went wrong.

Here's a fully functioning example of some things you can do with the user
object:

{% block header %}


Home

{% if user.is_authenticated %}


Projects
Reports
{% if user.is_staff %}
Usage
{% endif %}


{% if user.is_superuser %}
Settings
{% endif %}


{% if user.first_name %}
Welcome, {{ user.first_name }}
{% else %}
Welcome, {{ user.username }}
{% endif %}


Sign Out




{% endif %}

{% endblock %}

On Wed, Jul 29, 2015 at 4:20 PM, sarfaraz ahmed 
wrote:

> Hello All,
>
> I am facing an issue in my first django project. I am newbie. So, please
> help me in detail. I don't want to use {{full_name}} in all the views. I
> saw few post which says {{user.is_authenticated}} can be used. I tried but
> it was not working. Passing {'full_name':request.user.username} to each is
> very hectic. Also, not sure to this in one of my view where i am using
> password_change. View is mentioned below where i am not able pass full_name.
>
> This is mentioned below is my *navigation.html*
>
>
> 
>   
> 
> 
>data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
> aria-expanded="false">
> Toggle navigation
> 
> 
> 
>   
>   
> 
>
> 
>  id="bs-example-navbar-collapse-1">
>   
> Home  class="sr-only">(current)
> Sale  class="sr-only">(current)
> About Us
>
>   
> 
>   
>
> {%if full_name %}
>
> 
>
>role="button" aria-haspopup="true" aria-expanded="false">{{full_name}} class="caret">
>   
> My Account
> Orders
> Profile
> Change
> Password
> 
> Logout
>   
> 
> {% else %}
> Register
> Login
> {% endif %}
>   
> 
>   
> 
>
>
> 
> @login_required
> def
> my_change_password_view(request,template_name='useraccount/password_change_form.html'):
> return password_change(request,template_name)
>
> --
>
> Please help.
>
> Regards,
> Sarfaraz Ahmed
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f8521d79-c2a0-40a9-bd4e-0a90625264fe%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Bv0ZYW0S-UpbAvFY4RuVUQXKKRPsK3DhX1qefSQYvgFk3c3aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Want to change template based on full_name(request.user.username)

2015-07-29 Thread sarfaraz ahmed
Hello All,

I am facing an issue in my first django project. I am newbie. So, please 
help me in detail. I don't want to use {{full_name}} in all the views. I 
saw few post which says {{user.is_authenticated}} can be used. I tried but 
it was not working. Passing {'full_name':request.user.username} to each is 
very hectic. Also, not sure to this in one of my view where i am using 
password_change. View is mentioned below where i am not able pass full_name.

This is mentioned below is my *navigation.html*



  


  
Toggle navigation



  
  




  
Home (current)
Sale (current)
About Us
  
  

  

{%if full_name %}



  {{full_name}}
  
My Account
Orders
Profile
Change 
Password

Logout
  

{% else %}
Register
Login
{% endif %}
  

  



@login_required
def 
my_change_password_view(request,template_name='useraccount/password_change_form.html'):
return password_change(request,template_name)
--

Please help.

Regards,
Sarfaraz Ahmed

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f8521d79-c2a0-40a9-bd4e-0a90625264fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: About models validators location

2015-07-29 Thread durirompepc
Yeah, I can put it whenever I want, and just import then, but it is good to 
know the exact way (as when following PEP 8).

El miércoles, 29 de julio de 2015, 17:40:45 (UTC+2), felix escribió:
>
>  El 29/07/15 10:54, durir...@gmail.com  escribió:
>  
> I've searched for where to put the validators for my models, but I only 
> found that they fit in *models.py*, outside the model class. 
> Is that correct or I should create a specific file for them?
>  
>  I think that you can put validators in another file if you have several 
> of them or want to reuse them somewhere else. Just import them in models.py.
>
> 

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/af351e20-a462-473a-afd7-7ca688875fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting a PageNotFound 404 Error

2015-07-29 Thread Александр Мусаров
Thanks a lot!!! Damned regexes...

среда, 29 июля 2015 г., 19:56:46 UTC+3 пользователь James Schneider написал:
>
> Instead of /w you should use \w in your URL regex, right now all you are 
> matching is literally  - and / and w...
>
> -James
> On Jul 29, 2015 9:52 AM, "Александр Мусаров"  > wrote:
>
>> Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it, 
>> and now I'm having a mistake that I can not find in code myself. Please 
>> help me..
>>
>> The code is the following: 
>>
>> The trouble URL code line :   url(r'^(?P[-/w]+)/$', 
>> views.category, name = 'category_detail'),
>>
>> The view code : def category(request, category_slug):
>>c = get_object_or_404(Category, category_slug 
>> = category_slug)
>>products = c.product_set.all()
>>page_title = c.category_name
>>meta_keywords = c.category_meta_keywords
>>meta_description = c.category_meta_description
>>return render(request, 
>> 'categories/category.html', locals())
>>
>> Thanks for your help in advance..
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aed27f33-b955-4d32-a381-eaa65503de31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting a PageNotFound 404 Error

2015-07-29 Thread James Schneider
Instead of /w you should use \w in your URL regex, right now all you are
matching is literally  - and / and w...

-James
On Jul 29, 2015 9:52 AM, "Александр Мусаров"  wrote:

> Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it,
> and now I'm having a mistake that I can not find in code myself. Please
> help me..
>
> The code is the following:
>
> The trouble URL code line :   url(r'^(?P[-/w]+)/$',
> views.category, name = 'category_detail'),
>
> The view code : def category(request, category_slug):
>c = get_object_or_404(Category, category_slug =
> category_slug)
>products = c.product_set.all()
>page_title = c.category_name
>meta_keywords = c.category_meta_keywords
>meta_description = c.category_meta_description
>return render(request,
> 'categories/category.html', locals())
>
> Thanks for your help in advance..
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW65g%2BGYTg6Ok3%2BSUep1jUROkohAU%2BB_vfGs5Ges2ddfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Getting a PageNotFound 404 Error

2015-07-29 Thread Александр Мусаров
Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it, 
and now I'm having a mistake that I can not find in code myself. Please 
help me..

The code is the following: 

The trouble URL code line :   url(r'^(?P[-/w]+)/$', 
views.category, name = 'category_detail'),

The view code : def category(request, category_slug):
   c = get_object_or_404(Category, category_slug = 
category_slug)
   products = c.product_set.all()
   page_title = c.category_name
   meta_keywords = c.category_meta_keywords
   meta_description = c.category_meta_description
   return render(request, 
'categories/category.html', locals())

Thanks for your help in advance..

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: About models validators location

2015-07-29 Thread felix

El 29/07/15 10:54, duriromp...@gmail.com escribió:
I've searched for where to put the validators for my models, but I 
only found that they fit in *models.py*, outside the model class.

Is that correct or I should create a specific file for them?

I think that you can put validators in another file if you have several 
of them or want to reuse them somewhere else. Just import them in models.py.


--
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55B8F532.3090304%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


About models validators location

2015-07-29 Thread durirompepc
I've searched for where to put the validators for my models, but I only 
found that they fit in *models.py*, outside the model class.
Is that correct or I should create a specific file for 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 email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f13e32fa-bc14-4d35-9ca2-607460afd22f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to django with jquery-mobile

2015-07-29 Thread Alex Heyden
You pretty much answered it yourself.

>there's just one actual html page and inside it we have to create a page
(data-role="page")

Django's template helps you put together the response that gets to the
client. It's unaware of what your CSS and Javascript frameworks will do
with that response.

You can use Django's template features for better organization. Blocks are
an obvious one. You can also split pages and dialogs out into their own
.html files and include them to make a larger single response. That's just
organization, though. Your front-end system is separate from Django. That
would work the same way whether Django served that response or you saved it
to a file on your computer.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Bv0ZYWE8xdV-YEpim5EYh27U0_JGJUuWkeiiCWFQLRK1TvO4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Checking user permission denied in Django Selenium tests

2015-07-29 Thread Cherie Pun
 

On the local server that I start up, if the user does not have the required 
permission for a particular view, they will be redirected to the 403 page 
(I am using the permission_required decorator)

However, in the selenium test, the PermissionDenied exception is thrown and 
the user is redirected to the internal server error page (500) instead.

Does the server not work the same way when in selenium testing environment? 
Should I catch that exception in order to check permission is denied 
instead of checking for the 403 page? Cheers!
 

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dccd8e33-8f30-4aef-a030-644112efaf13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Learning Django problems

2015-07-29 Thread Robin Lery
Do u have static directory? And does it have the required resources?
On 29 Jul 2015 16:50, "Roshan Pannase"  wrote:

> sir i am a new learner  can you send me the code of this application
>
> On Wed, Jul 29, 2015 at 11:33 AM, Stas soroka 
> wrote:
>
>> I'm currently reading a book "Learning Django Web Development". Even
>> thoug I followed the book carefully, it says, that my page should look like
>> this:
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> When, in fact, my page looks like that:
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> I will be very greatful, if someone tell me, what can cause such a
>> problem.
>>
>> If it's needed - a link to my GitHub repository, with a code, that I
>> currently have - GitHub 
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d7f386bb-16ba-473e-81ea-bab24013d251%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGkvgN%3DgcihZhqy-zm%3D7BrAMOY%3D4VmbnQi1o%2B_L3jNQDACTB-w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B4-nGrZaa1Uodw09cXfY9cSAt1M-b-SGpmw_mCXuxEDKf2NYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Learning Django problems

2015-07-29 Thread Roshan Pannase
sir i am a new learner  can you send me the code of this application

On Wed, Jul 29, 2015 at 11:33 AM, Stas soroka  wrote:

> I'm currently reading a book "Learning Django Web Development". Even thoug
> I followed the book carefully, it says, that my page should look like this:
>
>
> 
>
>
>
>
>
>
>
>
>
>
>
> When, in fact, my page looks like that:
>
> 
>
>
>
>
>
>
>
>
>
>
>
> I will be very greatful, if someone tell me, what can cause such a problem.
>
> If it's needed - a link to my GitHub repository, with a code, that I
> currently have - GitHub 
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d7f386bb-16ba-473e-81ea-bab24013d251%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGkvgN%3DgcihZhqy-zm%3D7BrAMOY%3D4VmbnQi1o%2B_L3jNQDACTB-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tasty Pie in django

2015-07-29 Thread Anubhav Kaushik
yes i did , still i got no clues why save function in model related to the 
resource gets called three times.

On Wednesday, July 29, 2015 at 12:45:01 PM UTC+5:30, Avraham Serour wrote:
>
> tastypie has a very good documentation, have you tried reading it to 
> understand how it works?
>
> On Wed, Jul 29, 2015 at 6:19 AM, Anubhav Kaushik  > wrote:
>
>> If some one is having difficulty understanding my question. PLZ ASK.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9d2d2fd1-f261-4a26-9682-ff2f61acee61%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50bf8600-f803-4d07-b5d1-546821e131c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to django with jquery-mobile

2015-07-29 Thread Kakar Nyori
Django provides many features for the template (extends, block content
etc.) I am just learning jquery mobile, but so far when using jquery
mobile, there's just one actual html page and inside it we have to create a
page (data-role="page"). So, how can we utilize the django's templating
features with jquery mobile? Or how to django with jquery mobile? Please
help me understand this concept. Thank you.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoKmk3cjs6N-OiafJoA-wLT57aWzbVpk4NGaTdF7xffQzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tasty Pie in django

2015-07-29 Thread Anubhav Kaushik
yes i did , still i got no clues why save function in model related to the 
resource gets called three times.

On Tuesday, July 28, 2015 at 11:51:03 AM UTC+5:30, Anubhav Kaushik wrote:
>
> I am looking on code that someone else wrote , i am new to tasty pie , so 
> what i have understood that when ever someone gives a "POST" request then 
> resource's save method gets called.
> what is happening with my code is whenever some gives "POST request" , 
> save method gets called thrice and for some other resource it gets called 
> twice? 
>
> Can someone explain me the flow for tastypie and if possible ,the reason 
> of wicked behaviour of code.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/893946e2-4714-4838-92ee-abad908f1b57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Learning Django problems

2015-07-29 Thread Avraham Serour
Clearly the book example is using CSS and got aren't, maybe they forgot to
tell you to add or you aren't loading the static files

On Wed, Jul 29, 2015, 12:44 PM Stas soroka  wrote:

> I'm currently reading a book "Learning Django Web Development". Even thoug
> I followed the book carefully, it says, that my page should look like this:
>
>
> 
>
>
>
>
>
>
>
>
>
>
>
> When, in fact, my page looks like that:
>
> 
>
>
>
>
>
>
>
>
>
>
>
> I will be very greatful, if someone tell me, what can cause such a problem.
>
> If it's needed - a link to my GitHub repository, with a code, that I
> currently have - GitHub 
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d7f386bb-16ba-473e-81ea-bab24013d251%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6t%2Bq6pOJFBTHtdfyx6wya%2BY5%2BgW59FQsX%2BuGUOgA04Z22A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best practice for two variants of a language

2015-07-29 Thread Avraham Serour
I would create only one arrival locale and decide which one is the default,
probably the de_de would be the formal and the new language weighs be for
the informal.

As for the error messages I would just copy over the po for from django

On Wed, Jul 29, 2015, 12:58 PM Raphael Michel  wrote:

> Hello,
>
> I develop an open source web application in Django that is available in
> multiple languages, translated using Django's gettext features. However,
> in my native language German (and many others, too), there are strong
> differences between formal and informal style (in German there is even
> a formal and an informal word for "you").
>
> Some of my users need to use formal language and others need to use
> informal language and both have good reasons for that. So my question
> is: Is there a best practice on how to implement this?
>
> Contextual markers[1] are not an option, because you'd have to scatter
> the decision all over the code base, so you need to have different
> translation files for the different styles.
>
> I could use different gettext domains, but this would be pretty
> non-standard as Django normally uses only the "django" and "djangojs"
> domains.
>
> I could also abuse language code by using "de-formal" and "de-informal"
> instead of "de", but this would break Django's own translations (e.g.
> of validation error messages).
>
> Has anyone solved this problem in an elegant way before?
>
> Cheers,
> Raphael
>
>
> [1]
>
> https://docs.djangoproject.com/en/dev/topics/i18n/translation/#contextual-markers
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20150729115805.4e53c25f%40kvothe
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tLuO0b4KDD2Bz98MHUg7p7pNKec4fdWONyotSEKi_fRBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Best practice for two variants of a language

2015-07-29 Thread Raphael Michel
Hello,

I develop an open source web application in Django that is available in
multiple languages, translated using Django's gettext features. However,
in my native language German (and many others, too), there are strong
differences between formal and informal style (in German there is even
a formal and an informal word for "you").

Some of my users need to use formal language and others need to use
informal language and both have good reasons for that. So my question
is: Is there a best practice on how to implement this?

Contextual markers[1] are not an option, because you'd have to scatter
the decision all over the code base, so you need to have different
translation files for the different styles.

I could use different gettext domains, but this would be pretty
non-standard as Django normally uses only the "django" and "djangojs"
domains. 

I could also abuse language code by using "de-formal" and "de-informal"
instead of "de", but this would break Django's own translations (e.g.
of validation error messages).

Has anyone solved this problem in an elegant way before?

Cheers,
Raphael


[1]
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#contextual-markers

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20150729115805.4e53c25f%40kvothe.
For more options, visit https://groups.google.com/d/optout.


pgpmhqLqgtyZH.pgp
Description: Digitale Signatur von OpenPGP


Learning Django problems

2015-07-29 Thread Stas soroka
I'm currently reading a book "Learning Django Web Development". Even thoug 
I followed the book carefully, it says, that my page should look like this:













When, in fact, my page looks like that:












I will be very greatful, if someone tell me, what can cause such a problem.

If it's needed - a link to my GitHub repository, with a code, that I 
currently have - GitHub 

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d7f386bb-16ba-473e-81ea-bab24013d251%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tasty Pie in django

2015-07-29 Thread Avraham Serour
tastypie has a very good documentation, have you tried reading it to
understand how it works?

On Wed, Jul 29, 2015 at 6:19 AM, Anubhav Kaushik 
wrote:

> If some one is having difficulty understanding my question. PLZ ASK.
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9d2d2fd1-f261-4a26-9682-ff2f61acee61%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tLh1JCSxWkGYAPivvKfRE5feNijhwRQPAJSoEvRypimuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.