How to restrict save function in Django admin

2014-12-02 Thread Akshay Mukadam
Hi,
I have developed application that loads CSV file, if the input received 
while parsing the CSV file in Django admin is wrong, it throws a 
stacktrace, to avoid stacktrace I have handled the exception and I am able 
to show the error message using the Message framework in django. 
But the problem is that when I save the data it shows the error that CSV 
data is incorrect, but it also show save message, how could I override 
this.???
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/044a2983-696f-4588-a49c-ad4660fa699f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass request.user in .hbs file in django

2014-12-02 Thread JAI PRAKASH SINGH
sir,

   thank you for reply. but actually this mistake was while posting , in
my actual code  request.user is present .
   so please if some more  guidance from your side please share ...

On Tue, Dec 2, 2014 at 7:16 PM, Jerry Dumblauskas 
wrote:

> missing the t? reques.user to request.user
>
> On Tue, Dec 2, 2014 at 7:42 AM, JAI PRAKASH SINGH <
> jaiprakashsingh...@gmail.com> wrote:
>
>> hello all,
>>
>> i am very new to django , i have just started to work on django ,
>>
>> i am using .hbs file in django project
>> my aim is to use request.user in .hbs file
>>
>> i am trying this ...
>> not working
>>
>>
>>
>> ***view.py
>> data_dict = {...
>> 'user':reques.user,
>> # not working # but stacin name working like user:
>> "jp"
>>...}
>>
>> content_type = 'application/json'
>> return HttpResponse(json.dumps(data_dict), content_type)
>>
>>
>> ***.hbs
>> file*
>>
>>
>>  *{{response.user}}*NO
>> RATING
>>
>>
>>
>> 
>>
>>
>>
>>  --
>> 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/3a08e636-78ac-4342-8577-816ac25a29e9%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/rxIIoZ0dGLY/unsubscribe.
> To unsubscribe from this group and all its topics, 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%2BG_OOsDz5NJdNXGkHi8Y0gUZ1GwdSb%3DouSVPzdz68AiC27bVg%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/CAGtuQrjv-qCroYk1tWso8LLG9Gmh7qrdCYH54gEhoMuLkDJf8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django data replication example

2014-12-02 Thread Collin Anderson
Hi Sebastian,

Do you mean worked on a Django project where database replication was 
involved?

Collin

On Monday, December 1, 2014 1:31:19 PM UTC-5, Sebastian M Cheung wrote:
>
> Hi,
>
> Anyone worked on Django data replication project? Please comment your 
> experiences or links Thanks
>
>
>
> Sebastian
>

-- 
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/be94196e-0056-40ee-9436-5aaa79e2bf24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-02 Thread Collin Anderson
Hi,

It's probably possible. Do you mean url reversing the login view, or url 
reversing the view where login is required?

Collin

On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:
>
> Hi can this work with url reversing namespaced urls?
> thanks
>
> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>>
>> If you are usign class based generic views you can use the decorators in 
>> the URL config of your app, for example
>>
>> urlpatterns = patterns('',
>> (r'^about/', login_required(AboutView.as_view())),
>> )
>>
>>
>> On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:
>>
>>> Can I use both Generic View and the Django.contrib.auth features (such 
>>> as login_required decorator and other auth interface tool)? And if it is 
>>> not possible to integrate auth into Generic Views then can you recommend 
>>> alternative way of making the two work together? Adding to this I am using 
>>> Django 1.7v and python 3.4v. 
>>>
>>> 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...@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/09fe215a-4572-418c-959f-567e9ab05b0b%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/2a61f4c5-4406-4dd3-a893-df18882d8684%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query set append

2014-12-02 Thread check . django
Thanks guys . Appreciate the help !!

On Monday, December 1, 2014 11:07:59 AM UTC-8, check@gmail.com wrote:
>
> Hello 
>
> I am very new to python and Django . I have a basic question :
>
> 1. I have three database tables : Table A , Table B and Table C
> 2. in my views.py i do :
>
>- tableB_QuerySet = models.TableB.objects.filter(table_ID = value>)
>- *This returns 4 rows from table B *
>- Then i iterate over tableB_QuerySet 
>
> for x in tableB_QuerySet
> tableC_QuerySet = 
> models.TableC.objects.filter(tableC_id = x.)
>
>- I load the temple : template = loader.get_template(>.html>)
>- i use context : context  = RequestContext(request,{ '
>tableC_QuerySet': tableC_QuerySet,})
>- return HttpResponse(template.render(context))
>
> 3. In my html template i iterate over tableC_QuerySet and print it in a 
> table 
>
>
> problem is that in my HTML prints only the last entry of  tableC_QuerySet 
> . How do i append all the four entries from table C so that HTML gets all 
> the four entries rather than just the last one 
>
> PS: I cannot change the DB
>
> Thanks in advance 
> Appreciate your help
>
>
>
>

-- 
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/d30203df-4a3e-468a-b417-4a3feae6af5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-12-02 Thread Cal Leeming
Hi Mariusz,

Short answer - Hack something together in the fastest way possible, don't
worry about it being clean, tidy or even tested. Because if you do, you'll
still be working on this project in 2 years time... Look at using something
like PhoneGap [8], just enjoy the experience and ship it :)

If you genuinely want to start learning this stuff, you need to ask
yourself what it is you want to work on? Do you want to do backend (e.g.
all the server stuff, nothing visual), or do you want to do frontend (all
the visual/pretty stuff the user sees), or both? Are you doing this for
immediate financial gain [7], or a spiritual journey of self discovery and
learning [6]? The world of web dev is changing almost every couple of
months, stay on top of your game by reading blog articles from other
developers and keeping on top of tech new. Personally I use Feedly [9] to
aggregate these feeds into one place. Consider getting an internship
somewhere with other good programmers, learning from inspirational people
will speed up your personal development massively (I wish someone had told
me this 8 years ago).

Long answer;

Responsive/adaptive design does not necessarily make a good mobile
experience, and rarely will you find a mobile app which has the same
workflow as the website. Ideally you need to storyboard each experience and
wireframe the UX accordingly. Likewise with the UI, colors and sizes which
work well on desktop often won't work very well on mobile/tablet
(especially if you are designing your desktop site mostly towards PC users,
due to the variations in color display).

There are tools out there now which allow you to package up your
HTML/JS/CSS/images into a native application bundle, meaning you don't have
to learn how to write native applications. There are a whole bunch of these
products out there [1], but most of them suck, here's why. Building a
client side JS application is *hard*, you have to understand the different
JS design patterns in order to write clean and stable code, whilst
understanding the importance of unit testing [3] and real browser testing
[4]. You also have to understand the impact of latency, if you don't
compile your assets into a local bundle (instead opting to just wrap a
browser window in an IOS app), then your app experience will lag between
clicks (because each click is a page load). To get around this you need to
build your client side app to be completely independent of the server side,
which includes maintaining a view state (e.g. changing/rendering the
display upon changes being made). Other libraries exist for doing this such
as Ember [5] and others, but they are still quite alpha and have
performance concerns too. Also in regards to bundling, there are very few
tools out there which will automate this entire process, for example
creating a spritesheet of UI images so you don't have to make multiple HTTP
asset requests, or embedding the images as base64 in your stylesheet
(although that has render performance concerns).

Then you also have the API, building a clean RESTful api is difficult and
in actual fact may be the wrong approach for your mobile app.. why? Because
each API call has a lot of overhead, and this usually results in UI latency
if the user has poor signal. There is some work being done to use
websockets instead of ajax calls, but this starts to get into quite deep
territory.

Gonna cut this short, as I try to limit myself to 30 minutes on any given
reply. Again don't worry too much about what I've put in the long answer,
that's just there to give you some insight into the things you'll start
thinking about as you get deeper into your journey.

Hope this helps dude

Cal

[1] Google search for "app maker iphone"
[2] http://addyosmani.com/resources/essentialjsdesignpatterns/book/
[3] http://qunitjs.com/
[4] http://www.seleniumhq.org/
[5] http://emberjs.com/
[6]
http://www.amazon.co.uk/The-Clean-Coder-Professional-Programmers/dp/0137081073
[7] http://techcrunch.com/2012/03/25/dont-just-ship-it/
[8] http://phonegap.com/
[9] http://feedly.com/



On Fri, Nov 21, 2014 at 2:56 PM, Mariusz Wilk  wrote:

> I'm new to programming. Eventually, I'd like to make a website and an
> android/ios app that would work together and display pretty much the same
> content on a mobile as on the the web. Each client would log in (via mobile
> or desktop) and continue solving some exercises from the place he
> previously finished at. I have a potential client for this app, I don't
> have any deadline and if it works fine I shouldn't have any problems
> selling it to him and getting some commercial experience! So my question
> is: *what should I be learning to eventually reach this goal?* I've done
> a few Python tutorials/courses online, I played around with HTML, CSS and
> JS, right now I'm learning Kivy. Django scared me a lot, but maybe I should
> give it another try.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> 

Beginner: Creating a form with variable number of checkboxes

2014-12-02 Thread T Kwn
I'm creating a page where the user can add other users to a group. I am 
able to dynamically fetch all users and list them on a template with 
checkboxes. I'm getting stuck creating a form for them however.

I read this post (among others)

http://stackoverflow.com/questions/19947538/django-form-with-unknown-number-of-checkbox-fields-and-multiple-actions

I don't understand what should be used to define "choices" in this example. 
He says fill it with a queryset but which one?

choices = queryset_of_valid_choices,

Would that be something like objects_list.all()?


Currently my form is defined as this:

class UpdateGroup(forms.Form):
non_member_checkboxes = forms.MultipleChoiceField(
widget  = forms.CheckboxSelectMultiple,
)

I know it's missing something because the form.is_valid is always False.

-- 
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/8a9015f9-4ffd-46ca-976b-7af1a10a6a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-02 Thread Mike Dewhirst

On 3/12/2014 1:58 AM, Danish Ali wrote:

can someone help please ?


I haven't been watching this thread but I just solved a similar problem 
with 'NoneType is not iterable'


My problem was fixed when I ensured the functions involved got passed a 
type they were expecting.


I'm guessing you should work around the problem by avoiding autofill for 
the moment and slugify in the model.save method.




On Monday, December 1, 2014 6:35:56 PM UTC+5, Danish Ali wrote:

I am not sure about that.
is there any other easy way to get autofill slug then :)


On Monday, December 1, 2014 6:34:05 PM UTC+5, Jani Tiainen wrote:

On Mon, 1 Dec 2014 10:20:24 -0300
Vijay Khemlani  wrote:

 > Have you tried following the stacktrace that resulted in the
error?
 >
 > Does it fail when trying to strip the contents of the "name"
field?
 >

Or maybe that library where field AutoSlug comes from isn't
compatible
with your version of Django?

--

Jani Tiainen

--
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/a1180919-7547-493a-856c-22252fa6678e%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/547E4315.60108%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-12-02 Thread Mariusz Wilk

>
> Thanks. But is it possible to create a pretty web/mobile app with pop-ups, 
> buttons, input boxes, pics etc in Django/Python alone?  
>
I'm asking since I'm doing Django tutorial and so far I only have a 
> raw-looking poll (as an example).   
>
When a website is made with Django does it have to be paired with a lot of 
> HTML/CSS (maybe even JavaS) to look good? 
>

Also, does it matter what languages and environments does a company for 
whom I'm creating an app uses? Assuming that there is no 
interaction between their current website, databases etc and my new 
app?  

 

-- 
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/21aebab0-81ec-4da0-be20-e477ec7b85a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not found.

2014-12-02 Thread Terry Lang
That fixed it. I guess my eyes are getting bad. Thanks for the help.

On Tuesday, December 2, 2014 6:39:46 AM UTC-8, Terry Lang wrote:
>
> I am in the middle of tutorial 4, but am getting an error.
> What did I do wrong?
>
> NoReverseMatch at /polls/3/vote/ 
>
> Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
> found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']
>
>  Request Method: POST  Request URL: 
> http://www.alzacloud.net:8000/polls/3/vote/  Django Version: 1.7.1  Exception 
> Type: NoReverseMatch  Exception Value: 
>
> Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
> found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']
>
>  Exception Location: 
> /home/terryl/cloud/local/lib/python2.7/site-packages/django/core/urlresolvers.py
>  
> in _reverse_with_prefix, line 468  Python Executable: 
> /home/terryl/cloud/bin/python  Python Version: 2.7.6  Python Path: 
>
> ['/home/terryl/pjtcloud',
>  '/home/terryl/cloud/lib/python2.7',
>  '/home/terryl/cloud/lib/python2.7/plat-x86_64-linux-gnu',
>  '/home/terryl/cloud/lib/python2.7/lib-tk',
>  '/home/terryl/cloud/lib/python2.7/lib-old',
>  '/home/terryl/cloud/lib/python2.7/lib-dynload',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/home/terryl/cloud/local/lib/python2.7/site-packages',
>  '/home/terryl/cloud/lib/python2.7/site-packages']
>
>
> polls/urls.py
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from polls import views
>
> #urlpatterns = patterns('',
> #url(r'^polls/', include('polls.urls')),
> #url(r'^admin/', include(admin.site.urls)),
> #)
>
> # ex: /polls/
> # ex: /polls/5/
> # ex: /polls/5/results/
> # ex: /polls/5/vote/
> urlpatterns = patterns('',
> url(r'^$', views.index, name='index'),
> url(r'^(?P\d+)/$', views.detail, name='detail'),
> url(r'^(lP\d+)/results/$', views.results, name='results'),
> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
> )
>
>
> polls/views.py
>
> from django.shortcuts import get_object_or_404, renderfrom django.http import 
> HttpResponseRedirect, HttpResponsefrom django.core.urlresolvers import reverse
> from polls.models import Choice, Question# ...def vote(request, question_id):
> p = get_object_or_404(Question, pk=question_id)
> try:
> selected_choice = p.choice_set.get(pk=request.POST['choice'])
> except (KeyError, Choice.DoesNotExist):
> # Redisplay the question voting form.
> return render(request, 'polls/detail.html', {
> 'question': p,
> 'error_message': "You didn't select a choice.",
> })
> else:
> selected_choice.votes += 1
> selected_choice.save()
> # Always return an HttpResponseRedirect after successfully dealing
> # with POST data. This prevents data from being posted twice if a
> # user hits the Back button.
> return HttpResponseRedirect(reverse('polls:results', args=(p.id,)))
>
>
>

-- 
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/5911eaad-a0ee-4ef1-95c2-0e996d756dc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple levels of user in django application

2014-12-02 Thread Scot Hacker


On Tuesday, December 2, 2014 1:53:36 AM UTC-8, Anju SB wrote:
>
>
> We can't modify the 5 user details tables, because the other applications 
> are associated with that table. It is required to map these table with user 
> table.  But using the foreign key relationship we can only relate to one 
> table. How can I design models without affecting the 5 tables mentioned.  
>

 FK the UserProfile to those tables, not the other way around. That will 
leave them untouched/unmodified.

./s


-- 
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/89a54217-2270-4a04-9464-445fc3ca8792%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not found.

2014-12-02 Thread donarb
On Tuesday, December 2, 2014 6:39:46 AM UTC-8, Terry Lang wrote:
>
> I am in the middle of tutorial 4, but am getting an error.
> What did I do wrong?
>
> NoReverseMatch at /polls/3/vote/ 
>
> Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
> found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']
>
>  Request Method: POST  Request URL: 
> http://www.alzacloud.net:8000/polls/3/vote/  Django Version: 1.7.1  Exception 
> Type: NoReverseMatch  Exception Value: 
>
> Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
> found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']
>
>  Exception Location: 
> /home/terryl/cloud/local/lib/python2.7/site-packages/django/core/urlresolvers.py
>  
> in _reverse_with_prefix, line 468  Python Executable: 
> /home/terryl/cloud/bin/python  Python Version: 2.7.6  Python Path: 
>
> ['/home/terryl/pjtcloud',
>  '/home/terryl/cloud/lib/python2.7',
>  '/home/terryl/cloud/lib/python2.7/plat-x86_64-linux-gnu',
>  '/home/terryl/cloud/lib/python2.7/lib-tk',
>  '/home/terryl/cloud/lib/python2.7/lib-old',
>  '/home/terryl/cloud/lib/python2.7/lib-dynload',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/home/terryl/cloud/local/lib/python2.7/site-packages',
>  '/home/terryl/cloud/lib/python2.7/site-packages']
>
>
> polls/urls.py
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from polls import views
>
> #urlpatterns = patterns('',
> #url(r'^polls/', include('polls.urls')),
> #url(r'^admin/', include(admin.site.urls)),
> #)
>
> # ex: /polls/
> # ex: /polls/5/
> # ex: /polls/5/results/
> # ex: /polls/5/vote/
> urlpatterns = patterns('',
> url(r'^$', views.index, name='index'),
> url(r'^(?P\d+)/$', views.detail, name='detail'),
> url(r'^(lP\d+)/results/$', views.results, name='results'),
> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
> )
>
>
> polls/views.py
>
> from django.shortcuts import get_object_or_404, renderfrom django.http import 
> HttpResponseRedirect, HttpResponsefrom django.core.urlresolvers import reverse
> from polls.models import Choice, Question# ...def vote(request, question_id):
> p = get_object_or_404(Question, pk=question_id)
> try:
> selected_choice = p.choice_set.get(pk=request.POST['choice'])
> except (KeyError, Choice.DoesNotExist):
> # Redisplay the question voting form.
> return render(request, 'polls/detail.html', {
> 'question': p,
> 'error_message': "You didn't select a choice.",
> })
> else:
> selected_choice.votes += 1
> selected_choice.save()
> # Always return an HttpResponseRedirect after successfully dealing
> # with POST data. This prevents data from being posted twice if a
> # user hits the Back button.
> return HttpResponseRedirect(reverse('polls:results', args=(p.id,)))
>
>
>
Look at the regex for the results path match, you have a lowercase ell 
where there should be a question mark. 

-- 
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/a9144c16-af91-4187-8f55-91e23df5aa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect user inside Class-Based views

2014-12-02 Thread Rootz
thanks

On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote:
>
> 2014-12-02 15:17 GMT+01:00 Rootz >:
>
>> I have a small Django App using several Class-Based Views but I am 
>> contemplating how the class views would redirect a user based upon a 
>> condition? In my case I would like to redirect user who are not 
>> authenticated. Just how do I go about doing that?
>>
>> 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...@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/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> As long as the class based view doesn't require you to be logged in you 
> can achive that by doing:
>
> def dispatch(self, request, *args, **kwargs):
> if not request.user.is_authenticated():
> return HttpResponseRedirect(reverse("url_name_to_redirect_to"))
>
> # Continue with other dispatch functionality
>
> Regards,
>
> Andréas
>

-- 
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/d58084b0-b8c9-48bf-b6b4-f818cdf1d2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using login_required decorator

2014-12-02 Thread Rootz
Thanks I got it to work...

On Tuesday, December 2, 2014 7:22:30 AM UTC-5, Daniel Roseman wrote:
>
> On Monday, 1 December 2014 23:59:00 UTC, Rootz wrote:
>>
>> I have a small project but I am trying to restrict access on some of the 
>> django app urls to login users only. The problem is that when I hit a page 
>> that requires login users I expected that they(users) are redirected to the 
>> login page however that is not the case of what happens instead they are 
>> redirected to an example url link like this '/login?next=/detail/1/' with 
>> an error message as stated "TypeError at /login/ object() takes no 
>> parameters" 
>>
>> The django project url
>>
>>
>> (r'^detail/(?P\d{1,10})/$',login_required(views.DetailViewMember.as_view)),
>>
>>  
> This has nothing to do with the decorator. You need to *call* the as_view 
> method:
>   
> (r'^detail/(?P\d{1,10})/$',login_required(views.
> DetailViewMember.as_view())),
> --
> DR.
>

-- 
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/ff9b6f8d-9776-4196-a500-86ef533383bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-02 Thread Danish Ali
can someone help please ?

On Monday, December 1, 2014 6:35:56 PM UTC+5, Danish Ali wrote:
>
> I am not sure about that. 
> is there any other easy way to get autofill slug then :)
>
>
> On Monday, December 1, 2014 6:34:05 PM UTC+5, Jani Tiainen wrote:
>>
>> On Mon, 1 Dec 2014 10:20:24 -0300 
>> Vijay Khemlani  wrote: 
>>
>> > Have you tried following the stacktrace that resulted in the error? 
>> > 
>> > Does it fail when trying to strip the contents of the "name" field? 
>> > 
>>
>> Or maybe that library where field AutoSlug comes from isn't compatible 
>> with your version of Django? 
>>
>> -- 
>>
>> Jani Tiainen 
>>
>

-- 
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/a1180919-7547-493a-856c-22252fa6678e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not found.

2014-12-02 Thread Terry Lang
I am in the middle of tutorial 4, but am getting an error.
What did I do wrong?

NoReverseMatch at /polls/3/vote/ 

Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']

 Request Method: POST  Request URL: 
http://www.alzacloud.net:8000/polls/3/vote/  Django Version: 1.7.1  Exception 
Type: NoReverseMatch  Exception Value: 

Reverse for 'results' with arguments '(3L,)' and keyword arguments '{}' not 
found. 1 pattern(s) tried: [u'polls/(lP\\d+)/results/$']

 Exception Location: 
/home/terryl/cloud/local/lib/python2.7/site-packages/django/core/urlresolvers.py
 
in _reverse_with_prefix, line 468  Python Executable: 
/home/terryl/cloud/bin/python  Python Version: 2.7.6  Python Path: 

['/home/terryl/pjtcloud',
 '/home/terryl/cloud/lib/python2.7',
 '/home/terryl/cloud/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/terryl/cloud/lib/python2.7/lib-tk',
 '/home/terryl/cloud/lib/python2.7/lib-old',
 '/home/terryl/cloud/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/terryl/cloud/local/lib/python2.7/site-packages',
 '/home/terryl/cloud/lib/python2.7/site-packages']


polls/urls.py

from django.conf.urls import patterns, include, url
from django.contrib import admin
from polls import views

#urlpatterns = patterns('',
#url(r'^polls/', include('polls.urls')),
#url(r'^admin/', include(admin.site.urls)),
#)

# ex: /polls/
# ex: /polls/5/
# ex: /polls/5/results/
# ex: /polls/5/vote/
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^(?P\d+)/$', views.detail, name='detail'),
url(r'^(lP\d+)/results/$', views.results, name='results'),
url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
)


polls/views.py

from django.shortcuts import get_object_or_404, renderfrom django.http import 
HttpResponseRedirect, HttpResponsefrom django.core.urlresolvers import reverse
from polls.models import Choice, Question# ...def vote(request, question_id):
p = get_object_or_404(Question, pk=question_id)
try:
selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
# Redisplay the question voting form.
return render(request, 'polls/detail.html', {
'question': p,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
# Always return an HttpResponseRedirect after successfully dealing
# with POST data. This prevents data from being posted twice if a
# user hits the Back button.
return HttpResponseRedirect(reverse('polls:results', args=(p.id,)))


-- 
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/3995d3d9-63b9-4cb4-ab65-49c85e8c8b87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect user inside Class-Based views

2014-12-02 Thread Andreas Kuhne
2014-12-02 15:17 GMT+01:00 Rootz :

> I have a small Django App using several Class-Based Views but I am
> contemplating how the class views would redirect a user based upon a
> condition? In my case I would like to redirect user who are not
> authenticated. Just how do I go about doing that?
>
> 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/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


As long as the class based view doesn't require you to be logged in you can
achive that by doing:

def dispatch(self, request, *args, **kwargs):
if not request.user.is_authenticated():
return HttpResponseRedirect(reverse("url_name_to_redirect_to"))

# Continue with other dispatch functionality

Regards,

Andréas

-- 
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/CALXYUb%3D--DDF58S5MMcvo5-RLnekG0UiSVDH2FBxLpN1uqvYcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Redirect user inside Class-Based views

2014-12-02 Thread Rootz
I have a small Django App using several Class-Based Views but I am 
contemplating how the class views would redirect a user based upon a 
condition? In my case I would like to redirect user who are not 
authenticated. Just how do I go about doing that?

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/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass request.user in .hbs file in django

2014-12-02 Thread Jerry Dumblauskas
missing the t? reques.user to request.user

On Tue, Dec 2, 2014 at 7:42 AM, JAI PRAKASH SINGH <
jaiprakashsingh...@gmail.com> wrote:

> hello all,
>
> i am very new to django , i have just started to work on django ,
>
> i am using .hbs file in django project
> my aim is to use request.user in .hbs file
>
> i am trying this ...
> not working
>
>
>
> ***view.py
> data_dict = {...
> 'user':reques.user,
> # not working # but stacin name working like user: "jp"
>...}
>
> content_type = 'application/json'
> return HttpResponse(json.dumps(data_dict), content_type)
>
>
> ***.hbs
> file*
>
>
>  *{{response.user}}*NO
> RATING
>
>
>
> 
>
>
>
>  --
> 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/3a08e636-78ac-4342-8577-816ac25a29e9%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%2BG_OOsDz5NJdNXGkHi8Y0gUZ1GwdSb%3DouSVPzdz68AiC27bVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


how to pass request.user in .hbs file in django

2014-12-02 Thread JAI PRAKASH SINGH
hello all, 

i am very new to django , i have just started to work on django , 

i am using .hbs file in django project
my aim is to use request.user in .hbs file 

i am trying this ...
not working 


***view.py
data_dict = {...
'user':reques.user,
# not working # but stacin name working like user: "jp"
   ...}

content_type = 'application/json'
return HttpResponse(json.dumps(data_dict), content_type)


***.hbs 
file*


 *{{response.user}}*NO 
RATING






-- 
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/3a08e636-78ac-4342-8577-816ac25a29e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query set append

2014-12-02 Thread Florian Schweikert

On 2014-12-01 20:07, check.dja...@gmail.com wrote:

* I load the temple : template = loader.get_template(>.html>)
* i use context : context = RequestContext(request,{
'tableC_QuerySet': tableC_QuerySet,})
* return HttpResponse(template.render(context))


you may also have a look at the render shortcut:
https://docs.djangoproject.com/en/1.7/topics/http/shortcuts/#render

-- Florian

--
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/cb1971d3ad75fb9e265532b1a72e4237%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


Re: Using login_required decorator

2014-12-02 Thread Daniel Roseman
On Monday, 1 December 2014 23:59:00 UTC, Rootz wrote:
>
> I have a small project but I am trying to restrict access on some of the 
> django app urls to login users only. The problem is that when I hit a page 
> that requires login users I expected that they(users) are redirected to the 
> login page however that is not the case of what happens instead they are 
> redirected to an example url link like this '/login?next=/detail/1/' with 
> an error message as stated "TypeError at /login/ object() takes no 
> parameters" 
>
> The django project url
>
>
> (r'^detail/(?P\d{1,10})/$',login_required(views.DetailViewMember.as_view)),
>
>  
This has nothing to do with the decorator. You need to *call* the as_view 
method:
  
(r'^detail/(?P\d{1,10})/$',login_required(views.
DetailViewMember.as_view())),
--
DR.

-- 
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/20cae352-c3a8-4c8c-9296-00f735c2c82e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query set append

2014-12-02 Thread Daniel Roseman
On Monday, 1 December 2014 19:07:59 UTC, check@gmail.com wrote:
>
> Hello 
>
> I am very new to python and Django . I have a basic question :
>
> 1. I have three database tables : Table A , Table B and Table C
> 2. in my views.py i do :
>
>- tableB_QuerySet = models.TableB.objects.filter(table_ID = value>)
>- *This returns 4 rows from table B *
>- Then i iterate over tableB_QuerySet 
>
> for x in tableB_QuerySet
> tableC_QuerySet = 
> models.TableC.objects.filter(tableC_id = x.)
>
>- I load the temple : template = loader.get_template(>.html>)
>- i use context : context  = RequestContext(request,{ '
>tableC_QuerySet': tableC_QuerySet,})
>- return HttpResponse(template.render(context))
>
> 3. In my html template i iterate over tableC_QuerySet and print it in a 
> table 
>
>
> problem is that in my HTML prints only the last entry of  tableC_QuerySet 
> . How do i append all the four entries from table C so that HTML gets all 
> the four entries rather than just the last one 
>
> PS: I cannot change the DB
>
> Thanks in advance 
> Appreciate your help
>
>
Well, this is a basic programming issue, and nothing to do with Python or 
Django.

Each time through your loop, you re-assign `tableC_QuerySet` to a new 
value. So, naturally, the value that it has at the end of the loop is 
whatever it had in the last iteration. If you want to get all the elements 
from each iteration, you'll need to put them into a list. For example:

values = []
for x in tableB_QuerySet:
values.extend(list(models.TableC.objects.filter(tableC_id = 
x.)))

In addition, there is almost certainly a more efficient way to do it, 
rather than doing a separate query for each tableB item, but without seeing 
more details of your models it's impossible to help further.
--
DR.

-- 
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/44fcfb41-ab96-4cc4-a74c-9ae0b6d7c4c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-02 Thread Florian Schweikert

On 2014-12-02 10:59, Shashwat singh wrote:

ImportError: Could not import settings 'my_project.settings' (Is it on
sys.path? Is there an import error in the settings file?): No module
named my_project.settings

PLEASE HELP WITH THIS


there is not enough information to see the cause of the problem

what command did you run?
what was your cwd?
what does your project dir structure look like?

-- Florian

--
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/8cf64f5650e73b5ac2184d62e41d1405%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-02 Thread Daniel Roseman
On Tuesday, 2 December 2014 09:59:30 UTC, Shashwat singh wrote:
>
> 
>
> PLEASE HELP WITH THIS 
>

Nobody can possibly help with this. This is a random error message. What 
were you doing when you got it? What did you type at the command line? What 
code do you have already?

And, please do not shout.
--
DR.

-- 
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/0d255ab1-99e3-4eb3-a03f-2aabf38c98d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem Making New Django project - please help

2014-12-02 Thread Shashwat singh
 

Traceback (most recent call last):

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/bin/django-admin.py", 
line 5, in 

management.execute_from_command_line()

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 385, in execute_from_command_line

utility.execute()

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 345, in execute

settings.INSTALLED_APPS

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 46, in __getattr__

self._setup(name)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 42, in _setup

self._wrapped = Settings(settings_module)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 98, in __init__

% (self.SETTINGS_MODULE, e)

ImportError: Could not import settings 'my_project.settings' (Is it on 
sys.path? Is there an import error in the settings file?): No module named 
my_project.settings



PLEASE HELP WITH THIS 

-- 
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/2341dfba-7c40-46b0-8a9f-7a03218e0054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple levels of user in django application

2014-12-02 Thread Anju SB



We can't modify the 5 user details tables, because the other applications 
are associated with that table. It is required to map these table with user 
table.  But using the foreign key relationship we can only relate to one 
table. How can I design models without affecting the 5 tables mentioned.  




On Tuesday, 2 December 2014 12:25:48 UTC+5:30, Scot Hacker wrote:
>
>
>
> On Monday, December 1, 2014 9:00:51 PM UTC-8, Anju SB wrote:
>>
>> Actually I can't change the models of the different user details 
>> (state_data,district_data,dub-division_data,circle_data,station_data) 
>> because these tables are used for other GIS activities.  
>> I need to map user with these tables.
>>
>>
> Looks like you deleted the message that contained the schema for the other 
> tables, but I would probably give each of them a ForeignKey connection to 
> your UserProfile model. Then you can do something like 
>
> profile = UserProfile.objects.get(user__username='joe')
>
> if profile.StateData:
> 
>
> It's hard to say more without being closer to the code or having a better 
> sense of your goals.
>
> ./s 
>

-- 
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/94785055-7cea-4df2-be23-476b66094d96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN: eGenix mxODBC Connect 2.1.2 - Python Database Interface

2014-12-02 Thread eGenix Team: M.-A. Lemburg

ANNOUNCING
  eGenix.com mxODBC Connect

  Python Database Interface

Version 2.1.2


 mxODBC Connect is our commercially supported client-server product for
   connecting Python applications to relational databases
 in a truly platform independent way.


This announcement is also available on our web-site for online reading:
http://www.egenix.com/company/news/eGenix-mxODBC-Connect-2.1.2-GA.html


INTRODUCTION

The mxODBC Connect Database Interface for Python allows users to
easily connect Python applications to all major databases on the
market today in a highly portable, convenient and secure way.

Python Database Connectivity the Easy Way
-

Unlike our mxODBC Python extension, mxODBC Connect is designed as
client-server application, so you no longer need to find production
quality ODBC drivers for all the platforms you target with your Python
application.

Instead you use an easy to install royalty-free Python client library
which connects directly to the mxODBC Connect database server over the
network.

This makes mxODBC Connect a great basis for writing cross-platform
multi-tier database applications and utilities in Python, especially
if you run applications that need to communicate with databases such
as MS SQL Server and MS Access, Oracle Database, IBM DB2 and Informix,
Sybase ASE and Sybase Anywhere, MySQL, PostgreSQL, SAP MaxDB and many
more, that run on Windows or Linux machines.

Ideal for Database Driven Client Applications
-

By removing the need to install and configure ODBC drivers on the
client side and dealing with complicated network setups for each set
of drivers, mxODBC Connect greatly simplifies deployment of database
driven client applications, while at the same time making the network
communication between client and database server more efficient and
more secure.

For more information, please have a look at the mxODBC Connect product
page, in particular, the full list of available features.

For more information, please see the product page:

http://www.egenix.com/products/python/mxODBCConnect/


NEWS

mxODBC Connect 2.1.2 is a patch level release of our successful mxODBC
Connect product.

In the last patch level release 2.1.1, we had put a lot of emphasis on
enhancing the TLS/SSL setup of the mxODBC Connect product:

https://cms.egenix.com/company/news/eGenix-mxODBC-Connect-2.1.1-GA.html

In this release, we are fixing a pip installation problem, that
occurred with the mxODBC Connect Client on a few platforms, as well as
a some other minor issues we found:

Security Enhancements
-

 * OpenSSL cipher string list updated to explicitly disallow use of
   low security or export ciphers.

mxODBC Connect Enhancements
---

 * Fixed a problem that could cause the mxODBC Connect Client to not
   install correctly with pip.

 * Successfully tested against Python 2.7.9, which will come with a
   new ssl module.

 * Fixed the package version number to show the correct release
   version.

 * Fixed OpenSSL warnings in the Unix installer and scripts.

For the full set of changes, including those of the 2.1 series of
mxODBC Connect, please check the mxODBC Connect change log:

http://www.egenix.com/products/python/mxODBCConnect/changelog.html


UPGRADING

You are encouraged to upgrade to this latest mxODBC Connect release.
When upgrading, please always upgrade both the server and the client
installations to the same version - even for patch level releases.

We will give out 20% discount coupons for upgrade purchases going from
mxODBC Connect Server 1.x to 2.1 and 50% coupons for upgrades from
mxODBC 2.x to 2.1. Please contact the eGenix.com Sales Team
(sa...@egenix.com) with your existing license serials for details.

Users of our stand-alone mxODBC product will have to purchase new
licenses from our online shop in order to use mxODBC Connect.

You can request free 30-day evaluation licenses by visiting our
web-site or writing to sa...@egenix.com, stating your name (or the
name of the company) and the number of eval licenses that you need.

http://www.egenix.com/products/python/mxODBCConnect/#Evaluation


DOWNLOADS

The download archives as well as instructions for installation and
configuration of the product can be found on the product page:

http://www.egenix.com/products/python/mxODBCConnect/

If you want to try the package, jump straight to the download
instructions:

https://cms.egenix.com/products/python