Re: Django for non web clients

2013-06-30 Thread Rahul Gaur
Hi,
What about change-tastypie or django-restframework or something similar ?
As a part of my GSoC project [1] , I am implementing a project sharing web
site with social features.
I need RESTful APIs so that the functionality of the site could be
integrated into SugarLabs [2].

I am planing to use Django with one of the above rest frameworks to serve
RESTful APIs  and a web client in backbone.js which will consume the APIs
as well.

[1] - https://github.com/aregee/moksaya
[2] - http://sugarlabs.org
On Jun 30, 2013 12:13 PM, "zweb"  wrote:

>
> I am writing an Python application which will expose REST API. It will be
> client agnostic. In future I will provide a Web client and a mobile client
> and may be a rich desktop client. These clients will connect to application
> using the REST api only.
>
> Should I use Django for this? or is Django for Web based applications only
> as it is web framework. What advantage does Django brings in such a
> architecture.
>
> Would it be much simpler if I use simple python with some python rest  web
> services framework on top of it instead of Django?
>
> I am a big fan of Django but not sure if a Web framework such as django is
> good fit for REST Services based architecture. I not building a
> (monolithic) web application.
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




data transfer between databases

2013-06-30 Thread Mike Dewhirst
This is probably a Postgres question but someone might be able to offer 
advice on how to transfer data :)


New "reference" or read-only data gets input during development and I 
want to transfer it to the production database from time to time.


I think my choices are:

1. Re-enter it manually - only if all else fails.

2. Use Django's multi-database feature and write a utility to transfer 
data which doesn't already exist. Except the databases are on different 
machines in different data centres.


3. Exploit some pre-existing tool written for precisely this problem.

Any suggestions?

There are currently three reference tables involved and two have m2m 
relationships between themselves. The other is stand-alone.


Customer data is fine in the production database and won't be touched. 
There are no relationships with the reference tables.


Thanks

Mike

--
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django search query

2013-06-30 Thread Harjot Mann
Reply waited.


--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ajax

2013-06-30 Thread Christian Schmitt
Every Framework supports Ajax. But as i already mentioned and as already 
talked about in the django-developers, the support of serialization and 
other things is really really crappy and needs to be fixed.
Especially SPA sites needs some love. I mean in the core Django is cool, 
and since the new cbv's i really love django and the ajax support is better 
now, but some things are still messy.

Am Sonntag, 30. Juni 2013 02:24:30 UTC+2 schrieb Russell Keith-Magee:
>
>
> On Sat, Jun 29, 2013 at 11:51 PM, Gamesbrainiac 
> 
> > wrote:
>
>> Sorry, was on a mobile phone. Let me give you exact link, please excuse 
>> me being a little stupid.
>>
>> https://code.djangoproject.com/wiki/AJAX -> First line, "Django does not 
>> natively support Ajax". 
>>
>
> That comment is on the wiki. The wiki can be contributed by anybody, and 
> isn't reviewed by the core team. As a result, the advice found there can 
> often be wrong or misleading.
>
>  Allow me to confirm that the advice that Django "doesn't support AJAX" is 
> *incorrect*. I've just corrected the wiki page.
>
> Yours,
> Russ Magee %-)
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




A question for encoding issue when I read file by python

2013-06-30 Thread Zhao Quan
Hi all,

when I try to read a file which actual encoding is gbk.

I get exception as below:
--
Traceback (most recent call last):
  File "", line 1, in 
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py",
line 675, in readline
return self.reader.readline(size)
UnicodeDecodeError: 'gb2312' codec can't decode bytes in position 0-1:
illegal multibyte sequence
--

here is my code:
--
>>> import codecs
>>> f = codecs.open('namelist.txt',encoding='gb2312')
>>> f.readline()
--

Data example:
--
曹星 iamcaoyuxin
--

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Render dynamic form based on meta data

2013-06-30 Thread Avishay Balderman
Hi  François 
Since I am a django "newbe", can you please elaborate or even point me to 
refrences in the web that shows the concept of what I am looking for?
Thanks

Avishay

On Saturday, June 29, 2013 3:58:32 PM UTC+3, François Schiettecatte wrote:
>
> Django can handle some of that for you but not all, you will need to use 
> javascript to handle the dynamics on the page itself., I use jquery, and 
> use django to take the ajax calls and return data. 
>
> If you don't have that much data you could just add it to the HTML page in 
> javascript structures, would be easier to deal with than making ajax calls. 
>
> Cheers 
>
> François 
>
> On Jun 29, 2013, at 5:28 AM, Avishay Balderman 
> > 
> wrote: 
>
> > Hi 
> > I need to implement a django app that has the following capabilities: 
> > 1) When the main page loads it needs to dynamically (Ajax) populate a 
> combo () with a list of "form types" 
> > 2) When the user select an item from the "form types" combo, the app 
> should issue Ajax call and fetch meta data. This meta data will bu used in 
> order to render a form. 
> > 
> > Can you please advice? 
> > 
> > Thanks 
> > 
> > Avishay 
> > 
> > 
> > -- 
> > 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. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Get Form from string?

2013-06-30 Thread MacVictor
I try in view get the form by name.
Example:
this is my url: 

/some-url/MyForm/

url(r'^/some-url/(?P[a-zA-Z0-9]+)/', 'my_view', name='my-wiev'),


and my view:

def my_view(request, form_name):
form = how_get_form_name(form_name)
response = {}
response['my_form'] = form
return render_to_response('request/window.html', response)


I have create uniwersal view, get my form and send to template. Why form? 
Because my model has more Forms and I want to select which forms.



W dniu piątek, 28 czerwca 2013 23:06:15 UTC+2 użytkownik yeswanth nadella 
napisał:
>
> I am afraid, I did not understand your question. Are you trying to 
> generate a form based on your model/ models? 
>
> On Friday, June 28, 2013 3:23:00 PM UTC-5, MacVictor wrote:
>>
>> and how to get only Form (not ModelForm) use string name?
>>
>> W dniu piątek, 28 czerwca 2013 22:09:41 UTC+2 użytkownik MacVictor 
>> napisał:
>>>
>>> get the model by string i use:
>>>
>>> from django.db.models.loading import get_model
>>> def get_model(self, app_label, model_name, seed_cache=True):
>>>
>>> how to get ModelForm by string?
>>>
>>> i try used:
>>>
>>> modelforms = forms.ModelForm.__subclasses__()
>>>
>>> def get_form(form):
>>> try:
>>> for model_form in modelforms:
>>> try:
>>> if model_form.Meta.form == form:
>>> return model_form
>>> except AttributeError:
>>> continue
>>> except IndexError:
>>> print "Does not exist Model Forms for the object"
>>>
>>> but I must import the form in which I will seek appropriate by name!
>>>
>>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Get Form from string?

2013-06-30 Thread MacVictor
Sorry but I forgot show my form:

This is my Form:

class MyForm(ModelForm):
class Meta:
form = 'my_form'
model = MyModel
exclude = ('country', 'region')

My all form in subclass Meta contains variable 'form'. This is name of my 
form. The definition get_form search in all included form one string name, 
and return this Form.

Example:
url:

url(r'^/some-url/(?P[a-zA-Z0-9]+)/', 'my_view', name='my-wiev'),

and view:

def my_view(request, form_name):
form = get_form(my_form)
response = {}
response['my_form'] = form
return render_to_response('request/window.html', response)


W dniu piątek, 28 czerwca 2013 22:09:41 UTC+2 użytkownik MacVictor napisał:
>
> get the model by string i use:
>
> from django.db.models.loading import get_model
> def get_model(self, app_label, model_name, seed_cache=True):
>
> how to get ModelForm by string?
>
> i try used:
>
> modelforms = forms.ModelForm.__subclasses__()
>
> def get_form(form):
> try:
> for model_form in modelforms:
> try:
> if model_form.Meta.form == form:
> return model_form
> except AttributeError:
> continue
> except IndexError:
> print "Does not exist Model Forms for the object"
>
> but I must import the form in which I will seek appropriate by name!
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: data transfer between databases

2013-06-30 Thread Avraham Serour
manage.py dumpdata


On Sun, Jun 30, 2013 at 10:40 AM, Mike Dewhirst wrote:

> This is probably a Postgres question but someone might be able to offer
> advice on how to transfer data :)
>
> New "reference" or read-only data gets input during development and I want
> to transfer it to the production database from time to time.
>
> I think my choices are:
>
> 1. Re-enter it manually - only if all else fails.
>
> 2. Use Django's multi-database feature and write a utility to transfer
> data which doesn't already exist. Except the databases are on different
> machines in different data centres.
>
> 3. Exploit some pre-existing tool written for precisely this problem.
>
> Any suggestions?
>
> There are currently three reference tables involved and two have m2m
> relationships between themselves. The other is stand-alone.
>
> Customer data is fine in the production database and won't be touched.
> There are no relationships with the reference tables.
>
> Thanks
>
> Mike
>
> --
> 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+unsubscribe@**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
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django for non web clients

2013-06-30 Thread zweb
Thanks Rahul,

I thought about that. 

I do not need Django's ORM as I do not use relational db and I do not need 
Django's Templates as I use rest api. So I am not sure what value does 
django add in my case?



On Sunday, June 30, 2013 12:24:28 AM UTC-7, Rahul Gaur wrote:
>
> Hi, 
> What about change-tastypie or django-restframework or something similar ?
> As a part of my GSoC project [1] , I am implementing a project sharing web 
> site with social features.
> I need RESTful APIs so that the functionality of the site could be 
> integrated into SugarLabs [2]. 
>
> I am planing to use Django with one of the above rest frameworks to serve 
> RESTful APIs  and a web client in backbone.js which will consume the APIs 
> as well.
>
> [1] - https://github.com/aregee/moksaya
> [2] - http://sugarlabs.org 
> On Jun 30, 2013 12:13 PM, "zweb" > wrote:
>
>>
>> I am writing an Python application which will expose REST API. It will be 
>> client agnostic. In future I will provide a Web client and a mobile client 
>> and may be a rich desktop client. These clients will connect to application 
>> using the REST api only. 
>>
>> Should I use Django for this? or is Django for Web based applications 
>> only as it is web framework. What advantage does Django brings in such a 
>> architecture.
>>
>> Would it be much simpler if I use simple python with some python rest  
>> web services framework on top of it instead of Django?
>>
>> I am a big fan of Django but not sure if a Web framework such as django 
>> is good fit for REST Services based architecture. I not building a 
>> (monolithic) web application.
>>
>> -- 
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Render dynamic form based on meta data

2013-06-30 Thread François Schiettecatte
Avishay

Take a look at http://jquery.com/ , lots of stuff there. 

The other discussions that have been going on about REST would also be useful 
to you.

Cheers

François

On Jun 30, 2013, at 4:54 AM, Avishay Balderman  wrote:

> Hi  François 
> Since I am a django "newbe", can you please elaborate or even point me to 
> refrences in the web that shows the concept of what I am looking for?
> Thanks
> 
> Avishay
> 
> On Saturday, June 29, 2013 3:58:32 PM UTC+3, François Schiettecatte wrote:
> Django can handle some of that for you but not all, you will need to use 
> javascript to handle the dynamics on the page itself., I use jquery, and use 
> django to take the ajax calls and return data. 
> 
> If you don't have that much data you could just add it to the HTML page in 
> javascript structures, would be easier to deal with than making ajax calls. 
> 
> Cheers 
> 
> François 
> 
> On Jun 29, 2013, at 5:28 AM, Avishay Balderman  wrote: 
> 
> > Hi 
> > I need to implement a django app that has the following capabilities: 
> > 1) When the main page loads it needs to dynamically (Ajax) populate a combo 
> > () with a list of "form types" 
> > 2) When the user select an item from the "form types" combo, the app should 
> > issue Ajax call and fetch meta data. This meta data will bu used in order 
> > to render a form. 
> > 
> > Can you please advice? 
> > 
> > Thanks 
> > 
> > Avishay 
> > 
> > 
> > -- 
> > 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. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
> 
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




send query by using a textbox of html to python(django)

2013-06-30 Thread mash . papillon
i work on a project in which i could send query by using a textbox of html 
to django .then django can process on this query and assign the return 
value as list in html.

now, i ask the following question:

 how can we send a number from text box of html to python(django) and after 
that django multiply this output number in 3 and return this number as list 
in html 

tnx

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




HELP : Installation of Django 1.6 in Windows

2013-06-30 Thread Othmane Abouelaecha
Hi !! I recently learned to program with python 3.2
I have a difficulty concerning Django 
I want to install the latest version 1.6 that supports python 3.2
I only found a way to install in Linux but I'm running Windows 7 !! 
Can anyone show me how ? And also if you have any book or tutorial about 
Django please send it to me ! 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: data transfer between databases

2013-06-30 Thread mulianto
Hi,

Lowest level approach will be just using pgdump for the spesific table or whole 
database.

Regards,

mulianto

Sent from my iPhone

On 30 Jun 2013, at 19:37, Avraham Serour  wrote:

> manage.py dumpdata
> 
> 
> On Sun, Jun 30, 2013 at 10:40 AM, Mike Dewhirst  wrote:
>> This is probably a Postgres question but someone might be able to offer 
>> advice on how to transfer data :)
>> 
>> New "reference" or read-only data gets input during development and I want 
>> to transfer it to the production database from time to time.
>> 
>> I think my choices are:
>> 
>> 1. Re-enter it manually - only if all else fails.
>> 
>> 2. Use Django's multi-database feature and write a utility to transfer data 
>> which doesn't already exist. Except the databases are on different machines 
>> in different data centres.
>> 
>> 3. Exploit some pre-existing tool written for precisely this problem.
>> 
>> Any suggestions?
>> 
>> There are currently three reference tables involved and two have m2m 
>> relationships between themselves. The other is stand-alone.
>> 
>> Customer data is fine in the production database and won't be touched. There 
>> are no relationships with the reference tables.
>> 
>> Thanks
>> 
>> Mike
>> 
>> -- 
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django for non web clients

2013-06-30 Thread Rahul Gaur
Both the above mentioned frameworks offer support for non orm data
resources.
See tastypie's official docs on how to use it with riakdb [1] .

And I have also used django rest framework to relay RESTful APIs for a
django app which uses restful apis from a locally running REST server.

So the data source here wasn't rdbms or non-rel db but json feed from local
web server.
Since this server had a django based web  interface which consumed these
APIs , and we couldn't expose this directly to web as it expose lots of
level and raw data.

Whereas the django based web app offered limited functionality that we
would like to offer clients with  api as well.
Rolling out authenticated public facing restful APIs with django made more
sense .

Using these frameworks I am under the impression  that I could develop
product faster as compared to rolling out my own APIs  and authorization
and authentication is less complex as already there are very good existing
django apps that ease the job (dry) :-)

Just my thoughts :-)

[1] -
http://django-tastypie.readthedocs.org/en/latest/non_orm_data_sources.html
On Jun 30, 2013 7:36 PM, "zweb"  wrote:

> Thanks Rahul,
>
> I thought about that.
>
> I do not need Django's ORM as I do not use relational db and I do not need
> Django's Templates as I use rest api. So I am not sure what value does
> django add in my case?
>
>
>
> On Sunday, June 30, 2013 12:24:28 AM UTC-7, Rahul Gaur wrote:
>>
>> Hi,
>> What about change-tastypie or django-restframework or something similar ?
>> As a part of my GSoC project [1] , I am implementing a project sharing
>> web site with social features.
>> I need RESTful APIs so that the functionality of the site could be
>> integrated into SugarLabs [2].
>>
>> I am planing to use Django with one of the above rest frameworks to serve
>> RESTful APIs  and a web client in backbone.js which will consume the APIs
>> as well.
>>
>> [1] - https://github.com/aregee/**moksaya
>> [2] - http://sugarlabs.org
>> On Jun 30, 2013 12:13 PM, "zweb"  wrote:
>>
>>>
>>> I am writing an Python application which will expose REST API. It will
>>> be client agnostic. In future I will provide a Web client and a mobile
>>> client and may be a rich desktop client. These clients will connect to
>>> application using the REST api only.
>>>
>>> Should I use Django for this? or is Django for Web based applications
>>> only as it is web framework. What advantage does Django brings in such a
>>> architecture.
>>>
>>> Would it be much simpler if I use simple python with some python rest
>>> web services framework on top of it instead of Django?
>>>
>>> I am a big fan of Django but not sure if a Web framework such as django
>>> is good fit for REST Services based architecture. I not building a
>>> (monolithic) web application.
>>>
>>> --
>>> 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
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: send query by using a textbox of html to python(django)

2013-06-30 Thread Daniel Drummond
Try following the tutorial here.  By the end of it yous hould be able to 
answer this yourself.  It doesn't take long to do, and you'll understand 
enough about Django to be able to extend your solution.

Dan

On Sunday, 30 June 2013 12:04:53 UTC+1, mash.p...@gmail.com wrote:
>
> i work on a project in which i could send query by using a textbox of html 
> to django .then django can process on this query and assign the return 
> value as list in html.
>
> now, i ask the following question:
>
>  how can we send a number from text box of html to python(django) and 
> after that django multiply this output number in 3 and return this number 
> as list in html 
>
> tnx
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django search query

2013-06-30 Thread Scot Hacker

On Saturday, June 29, 2013 9:32:19 PM UTC-7, Harjot Mann wrote:
>
> Is there any search query in django which can ignore vowels like I want to 
> make a query which displays all the clients name who writes their name as 
> 'amanjit' or 'amanjeet'. 
> It should take take ee=i or anything like this. Please help me I have to 
> finish my task asap. 
>

This is really a question about regular expressions, not about Django. 
Whether you implement simple or complex search in Django, whether you use 
Django or some other platform, this is going to come down to using a fairly 
complex regular expression. So I would search for "regex ignore vowels" and 
similar. I would also expect performing a search like that to be extremely 
expensive, computationally, since it will need to tear apart every single 
word in the pool. That, in turn, means you'll want to use a search system 
with very robust indexes. In fact, you might do best with a system that 
pre-indexes all of your content without vowels. 

./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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django search query

2013-06-30 Thread Harjot Mann
On Sun, Jun 30, 2013 at 10:18 PM, Scot Hacker  wrote:
> This is really a question about regular expressions, not about Django.
> Whether you implement simple or complex search in Django, whether you use
> Django or some other platform, this is going to come down to using a fairly
> complex regular expression. So I would search for "regex ignore vowels" and
> similar. I would also expect performing a search like that to be extremely
> expensive, computationally, since it will need to tear apart every single
> word in the pool. That, in turn, means you'll want to use a search system
> with very robust indexes. In fact, you might do best with a system that
> pre-indexes all of your content without vowels.


Yes this is exactly what I want, right now its a very simple search
but I want it to be a very good search.Please help me.

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django search query

2013-06-30 Thread Amirouche Boubekki
You can do this by creating an extra field in the model with the name
without vowels in it and doing a simple filter on it ? Is that what you
need ?


2013/6/30 Harjot Mann 

> On Sun, Jun 30, 2013 at 10:18 PM, Scot Hacker 
> wrote:
> > This is really a question about regular expressions, not about Django.
> > Whether you implement simple or complex search in Django, whether you use
> > Django or some other platform, this is going to come down to using a
> fairly
> > complex regular expression. So I would search for "regex ignore vowels"
> and
> > similar. I would also expect performing a search like that to be
> extremely
> > expensive, computationally, since it will need to tear apart every single
> > word in the pool. That, in turn, means you'll want to use a search system
> > with very robust indexes. In fact, you might do best with a system that
> > pre-indexes all of your content without vowels.
>
>
> Yes this is exactly what I want, right now its a very simple search
> but I want it to be a very good search.Please help me.
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: send query by using a textbox of html to python(django)

2013-06-30 Thread Daniel Drummond
Oops, forgot link: https://docs.djangoproject.com/en/1.5/

On Sunday, 30 June 2013 12:04:53 UTC+1, mash.p...@gmail.com wrote:
>
> i work on a project in which i could send query by using a textbox of html 
> to django .then django can process on this query and assign the return 
> value as list in html.
>
> now, i ask the following question:
>
>  how can we send a number from text box of html to python(django) and 
> after that django multiply this output number in 3 and return this number 
> as list in html 
>
> tnx
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: data transfer between databases

2013-06-30 Thread Mike Dewhirst

mulianto and Avraham

Thanks for your suggestions. Dumping data isn't the entire problem - 
which is this:


There will be an *ongoing* need to add new data from tables in one 
database to the same-named tables in another database on a remote 
machine. Two of the tables are in a m2m relationship.


Thanks

Mike

On 30/06/2013 5:40pm, Mike Dewhirst wrote:

This is probably a Postgres question but someone might be able to offer
advice on how to transfer data :)

New "reference" or read-only data gets input during development and I
want to transfer it to the production database from time to time.

I think my choices are:

1. Re-enter it manually - only if all else fails.

2. Use Django's multi-database feature and write a utility to transfer
data which doesn't already exist. Except the databases are on different
machines in different data centres.

3. Exploit some pre-existing tool written for precisely this problem.

Any suggestions?

There are currently three reference tables involved and two have m2m
relationships between themselves. The other is stand-alone.

Customer data is fine in the production database and won't be touched.
There are no relationships with the reference tables.

Thanks

Mike



--
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: data transfer between databases

2013-06-30 Thread François Schiettecatte
Mike

FWIW - I have a site for which I need to do that, I use MySQL so I just dump 
the data using mysqldump, transfer it to the other machine and load it up. 
There is some scripting around it to keep track of IDs so I dump deltas only, 
works just fine.

Best regards

François


On Jun 30, 2013, at 6:24 PM, Mike Dewhirst  wrote:

> mulianto and Avraham
> 
> Thanks for your suggestions. Dumping data isn't the entire problem - which is 
> this:
> 
> There will be an *ongoing* need to add new data from tables in one database 
> to the same-named tables in another database on a remote machine. Two of the 
> tables are in a m2m relationship.
> 
> Thanks
> 
> Mike
> 
> On 30/06/2013 5:40pm, Mike Dewhirst wrote:
>> This is probably a Postgres question but someone might be able to offer
>> advice on how to transfer data :)
>> 
>> New "reference" or read-only data gets input during development and I
>> want to transfer it to the production database from time to time.
>> 
>> I think my choices are:
>> 
>> 1. Re-enter it manually - only if all else fails.
>> 
>> 2. Use Django's multi-database feature and write a utility to transfer
>> data which doesn't already exist. Except the databases are on different
>> machines in different data centres.
>> 
>> 3. Exploit some pre-existing tool written for precisely this problem.
>> 
>> Any suggestions?
>> 
>> There are currently three reference tables involved and two have m2m
>> relationships between themselves. The other is stand-alone.
>> 
>> Customer data is fine in the production database and won't be touched.
>> There are no relationships with the reference tables.
>> 
>> Thanks
>> 
>> Mike
>> 
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: HELP : Installation of Django 1.6 in Windows

2013-06-30 Thread Mike Dewhirst

On 1/07/2013 12:16am, Othmane Abouelaecha wrote:

Hi !! I recently learned to program with python 3.2
I have a difficulty concerning Django
I want to install the latest version 1.6 that supports python 3.2
I only found a way to install in Linux but I'm running Windows 7 !!


You should be able to use the same technique on Windows 7.

1. Download the Django 1.6 zip file and unzip it into a temporary 
directory.


2. Get a command prompt and cd into the directory containing setup.py 
which is under the temporary directory


3. Execute the command "python setup.py install"

Should work.

Mike


Can anyone show me how ? And also if you have any book or tutorial about
Django please send it to me !

--
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.
For more options, visit https://groups.google.com/groups/opt_out.




--
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: data transfer between databases

2013-06-30 Thread Mike Dewhirst

On 1/07/2013 8:28am, François Schiettecatte wrote:

Mike

FWIW - I have a site for which I need to do that, I use MySQL so I
just dump the data using mysqldump, transfer it to the other machine
and load it up. There is some scripting around it to keep track of
IDs so I dump deltas only, works just fine.


François

I use Postgres but I'm sure that doesn't matter much. Would you be able 
to share your scripts? Off-list if you prefer. When I get it working 
I'll try and refine things so it becomes an easily repeatable process 
and post it all back here for others.


Miike



Best regards

François


On Jun 30, 2013, at 6:24 PM, Mike Dewhirst 
wrote:


mulianto and Avraham

Thanks for your suggestions. Dumping data isn't the entire problem
- which is this:

There will be an *ongoing* need to add new data from tables in one
database to the same-named tables in another database on a remote
machine. Two of the tables are in a m2m relationship.

Thanks

Mike

On 30/06/2013 5:40pm, Mike Dewhirst wrote:

This is probably a Postgres question but someone might be able to
offer advice on how to transfer data :)

New "reference" or read-only data gets input during development
and I want to transfer it to the production database from time to
time.

I think my choices are:

1. Re-enter it manually - only if all else fails.

2. Use Django's multi-database feature and write a utility to
transfer data which doesn't already exist. Except the databases
are on different machines in different data centres.

3. Exploit some pre-existing tool written for precisely this
problem.

Any suggestions?

There are currently three reference tables involved and two have
m2m relationships between themselves. The other is stand-alone.

Customer data is fine in the production database and won't be
touched. There are no relationships with the reference tables.

Thanks

Mike



-- 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. For more options,
visit https://groups.google.com/groups/opt_out.






--
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: HELP : Installation of Django 1.6 in Windows

2013-06-30 Thread Othmane Abouelaecha
Thanks. It took me a few more steps but I finally achieved it, I had to 
change the path for the command prompt to recognize python. Thanks a lot !! 

Le dimanche 30 juin 2013 14:16:43 UTC, Othmane Abouelaecha a écrit :
>
> Hi !! I recently learned to program with python 3.2
> I have a difficulty concerning Django 
> I want to install the latest version 1.6 that supports python 3.2
> I only found a way to install in Linux but I'm running Windows 7 !! 
> Can anyone show me how ? And also if you have any book or tutorial about 
> Django please send it to me ! 
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Change template block via AJAX

2013-06-30 Thread Andre Engelbrecht
What I normally do is to have a include template that contains only the 
content I would like to render.
I example:

{% block page_content %}

{% include 'xhr_page_content.html' %}

{% endblock %}

Using this approach you have isolated the content. Loading the page without 
ajax will just load the page as normal, and will include everything.
Now to make the ajax load all you need is to modify your view to check for 
request.is_ajax(), and if true, you change your view to render 
"xhr_page_content.html", instead of the full template.

That was the summary, hope it's clear enough.

On Saturday, 29 June 2013 17:54:56 UTC+1, Parin Porecha wrote:
>
> Hi,
>
> I have an application containing a topbar and rest is content area.
>
> In my 'base.html', I've defined two blocks -
>
> 
>   {% block topbar %}{% endblock topbar %}
>   {% block page_content %}
> {% block sidebar %}
> {% endblock sidebar %}
>   
> {% block main %}
> {% endblock main %}
> {% endblock page_content %}
> 
>
> These two blocks are then overridden by child templates.
> The topbar contains a search input. The search query is sent via AJAX, and 
> the results are loaded in respective child blocks through client-side 
> templating.
>
> Now, I want that whenever user enters a search query for a user via a 
> radio button instead of default, The block 'page_content' should get 
> overridden by another template 'user_results.html'. ( I'll know it 
> client-side itself )
> This can be done by redirecting to a path like '/search/user/', but that 
> would involve reloading of the page.
> Is this possible via an AJAX request, and then the server would load 
> another template which will replace the 'page_content' block without page 
> refresh ?
>
> -- 
> Regards,
> Parin Porecha
>
> say Kifflom!  and look forward 
> to 17.09.13 !
>  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Django 1.6 doesn't install via pip

2013-06-30 Thread Lachlan Musicman
Hola,

I read the release notes, and tried to install 1.6. I encountered this error:

$ pip install Django==1.6b1
Downloading/unpacking Django==1.6b1
  Could not find a version that satisfies the requirement
Django==1.6b1 (from versions: 1.2.6, 1.3.6, 1.2.7, 1.2.3, 1.2.4,
1.4.4, 1.3.3, 1.2.1, 1.3.4, 1.2.2, 1.5, 1.3, 1.4.5, 1.3.1, 1.1.3,
1.3.5, 1.2.5, 1.1.4, 1.2, 1.3.2, 1.3.7, 1.4.3, 1.4.1, 1.5.1, 1.4.2,
1.4)
No distributions matching the version for Django==1.6b1


I presume that the 1.6 alpha/beta hasn't been pushed to pypi yet?

cheers
L.

--
We are like a drunk blundering through a crowd of pickpockets. That we
are not poor and naked already is a testament to either the goodness
of humanity or the ineptitude of the criminal class.

http://techcrunch.com/2013/06/08/we-asked-for-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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django search query

2013-06-30 Thread Harjot Mann
On Sun, Jun 30, 2013 at 11:18 PM, Amirouche Boubekki
 wrote:
> You can do this by creating an extra field in the model with the name
> without vowels in it and doing a simple filter on it ? Is that what you need
> ?

I have a search function which is already working in views.py but I
want to refine it. How can I make a model without vowels??
And what is django-haystack application? Can I use it in my project
for fefinig search or is it a normal searching application?

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




dajaxice file cannot be found

2013-06-30 Thread no body
I am usering django_dajax 0.9.2 and django_dajaxice 0.5.5 for my current
project. This is how I configure it


#settings.py

*MAIN_DIR = os.path.dirname(__file__)
PROJECT_DIR = MAIN_DIR.rsplit(os.sep, 1)[0]

# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(MAIN_DIR, 'static'),
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'dajaxice.finders.DajaxiceFinder',
)*

and my urls.py
*
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
dajaxice_autodiscover()

if settings.DEBUG:
urlpatterns = patterns('',
(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)

urlpatterns += patterns('',
url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
...*


With this settings, I am enable to use these libs in my local machine.
However, when deploying to the client machine, the file dajaxice.core.js
cannot be found (see it on firebug). When use *python manage.py collecstatic
*, I see that that file is saved into the folder temp (*Copying
'/tmp/tmpsiiuMx'*). The rendered link is correct

**

and there is indeed that file under the /static/dajaxice folder, but still
the browser complains about cannot find that file. Do you have any idea
about 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.
For more options, visit https://groups.google.com/groups/opt_out.