Re: No distributions at all found for odfpy (from django-simple-import==1.9)

2014-05-08 Thread Alexis Gavidia
/usr/local/venv/bin/pip run on Thu May  8 23:20:37 2014
Downloading/unpacking odfpy
  Getting page https://pypi.python.org/simple/odfpy/
  Could not fetch URL https://pypi.python.org/simple/odfpy/: 404 Client 
Error: Not Found
  Will skip URL https://pypi.python.org/simple/odfpy/ when looking for 
download links for odfpy
  Getting page https://pypi.python.org/simple/
  URLs to search for versions for odfpy:
  * https://pypi.python.org/simple/odfpy/
  Getting page https://pypi.python.org/simple/odfpy/
  Could not fetch URL https://pypi.python.org/simple/odfpy/: 404 Client 
Error: Not Found
  Will skip URL https://pypi.python.org/simple/odfpy/ when looking for 
download links for odfpy
  Could not find any downloads that satisfy the requirement odfpy
Cleaning up...
  Removing temporary dir /usr/local/venv/build...
No distributions at all found for odfpy
Exception information:
Traceback (most recent call last):
  File "/usr/local/venv/lib/python2.6/site-packages/pip/basecommand.py", 
line 122, in main
status = self.run(options, args)
  File 
"/usr/local/venv/lib/python2.6/site-packages/pip/commands/install.py", line 
278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, 
bundle=self.bundle)
  File "/usr/local/venv/lib/python2.6/site-packages/pip/req.py", line 1177, 
in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/local/venv/lib/python2.6/site-packages/pip/index.py", line 
277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for odfpy


On Thursday, May 8, 2014 9:06:45 PM UTC-5, Alexis Gavidia wrote:
>
> Hi I've tried to install django-simple-import ver 1.9 but, Could not find 
> any downloads that satisfy the requirement odfpy
>
> Downloading/unpacking odfpy (from django-simple-import==1.9->-r 
> requirements/requirements.txt (line 19))
>
>   Could not find any downloads that satisfy the requirement odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
>   Some externally hosted files were ignored (use --allow-external odfpy to 
> allow).
>
> Cleaning up...
>
> No distributions at all found for odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
> Storing debug log for failure in /root/.pip/pip.log
>
> Br Alexis Gavidia
>

On Thursday, May 8, 2014 9:06:45 PM UTC-5, Alexis Gavidia wrote:
>
> Hi I've tried to install django-simple-import ver 1.9 but, Could not find 
> any downloads that satisfy the requirement odfpy
>
> Downloading/unpacking odfpy (from django-simple-import==1.9->-r 
> requirements/requirements.txt (line 19))
>
>   Could not find any downloads that satisfy the requirement odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
>   Some externally hosted files were ignored (use --allow-external odfpy to 
> allow).
>
> Cleaning up...
>
> No distributions at all found for odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
> Storing debug log for failure in /root/.pip/pip.log
>
> Br Alexis Gavidia
>

On Thursday, May 8, 2014 9:06:45 PM UTC-5, Alexis Gavidia wrote:
>
> Hi I've tried to install django-simple-import ver 1.9 but, Could not find 
> any downloads that satisfy the requirement odfpy
>
> Downloading/unpacking odfpy (from django-simple-import==1.9->-r 
> requirements/requirements.txt (line 19))
>
>   Could not find any downloads that satisfy the requirement odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
>   Some externally hosted files were ignored (use --allow-external odfpy to 
> allow).
>
> Cleaning up...
>
> No distributions at all found for odfpy (from 
> django-simple-import==1.9->-r requirements/requirements.txt (line 19))
>
> Storing debug log for failure in /root/.pip/pip.log
>
> Br Alexis Gavidia
>

-- 
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/2552b7d1-c0b4-4920-8b5d-f2f10b2774bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django documentation tutorial 3 questions. home page missing.

2014-05-08 Thread cheesiong lim
hi all,
 i am learning django by using django 1.6 documents tutorial 1 - 6.
 this round is my 4th try and, previous 3 try was successful and i 
understand more on every try.

 i am in tutorial 3 now, to create views.

 according to the documents, after i created a view, i need to map it to a 
URL.
 so i follow the documents to add a urls.py in the polls directory.
 and then i follow the document to add include() to mysite/urls.py
 i am able to so called wired an index view into the polls view.

 now if i go back to localhost:8000, i get an error page,
 so my question is
* 1) WHY?*
* 2) how to get back my localhost:8080 index page co-exist with  the polls 
index page?*

thank you very much everyone for your time. i am new and sorry for so 
simple question.
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/f3f727db-3c1f-493d-a581-f19376a9a6d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No distributions at all found for odfpy (from django-simple-import==1.9)

2014-05-08 Thread Alexis Gavidia


Hi I've tried to install django-simple-import ver 1.9 but, Could not find 
any downloads that satisfy the requirement odfpy

Downloading/unpacking odfpy (from django-simple-import==1.9->-r 
requirements/requirements.txt (line 19))

  Could not find any downloads that satisfy the requirement odfpy (from 
django-simple-import==1.9->-r requirements/requirements.txt (line 19))

  Some externally hosted files were ignored (use --allow-external odfpy to 
allow).

Cleaning up...

No distributions at all found for odfpy (from django-simple-import==1.9->-r 
requirements/requirements.txt (line 19))

Storing debug log for failure in /root/.pip/pip.log

Br Alexis Gavidia

-- 
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/462a4abb-b1b7-48ca-b350-c68d87be9025%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gallery App process

2014-05-08 Thread Venkatraman S
On Thu, May 8, 2014 at 12:43 PM, bradford li  wrote:

> I want to know how to display images separated by albums onto a page in
> Django. So far, I've learned how to do so with the line
>
> 
>
> in my html file.
>
> What I want to do is have a few album thumbnails out and upon click, all
> the images from the album should be displayed. I believe I would do this
> with an AJAX request. I am probably going to categorized these photos with
> tags and put names one them and other characteristics.
>
> I am new to Django so I am not sure where and how to start with this app
> of mine. Could someone lend me a hand and propose a method ot guideline on
> how to do so? Much appreciated!
>

Have a look at django-photologue for some code-inspiration.

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


Re: active/alive Calendar app options for Django

2014-05-08 Thread Venkatraman S
On Fri, May 9, 2014 at 1:55 AM, Adam Teale  wrote:

> Hi guys,
>
> Quick question, anyone using or know of a calendar app that is currently
> in active development that i could use in my django app?
>
> I've been trying to get django-swingtime and django_bootstrap_calendar but
> i've got errors that i can't seem to resolve and i think their dev on
> github might not be very active.
>
> Ideally i'd like to implement something as cool as iCal / Google calendar
> - with dragable objects to set the start and end times
>
>
I use django_bootstrap_calendar and it works absolutely fine for me. There
are some bugs in the week and date views and I need to merge them asap -
probably this weekend.

Also, if you find any other bugs in  django_bootstrap_calendar, do mention
in issues - the dev atleast replies back.

-- 
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/CAN7tdFTQLNSH%3D2xF4fFhNyf4opQmaquHpFmLhVY54_P-ws5%2BYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gallery App in Django project

2014-05-08 Thread Venkatraman S
On Fri, May 9, 2014 at 4:22 AM, m1chael  wrote:

> photologue may work for you.. i use it, and have customized it very
> extensively for my needs


+1. Very easy to customize and play with.  Does most of the functions
needed of a photo-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/CAN7tdFTFJfMoSY7BBiYn7Lc6SrBxgKQYDirKHSVgpi_egQHLew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: About django round-up display function of time

2014-05-08 Thread hito koto
Thank you!

2014年5月7日水曜日 23時05分18秒 UTC+9 somecallitblues:
>
> I assume you're using datetime object in which case you have a look at 
> this SO answer 
> http://stackoverflow.com/questions/3463930/how-to-round-the-minute-of-a-datetime-object-python
>
>
> On 7 May 2014 17:55, hito koto  wrote:
>
>> Hi , good afternoon!
>>
>> I want to the round-up display function of time, how do i can do it , 
>> please help me!!
>> (Django/Python)
>>
>> For example:
>>
>> 2, 09:30 minute = 09:40
>> 09:15minute= 09:45
>> 09:30minute= 10:00
>> 09:31minute = 09:31
>>
>>
>>  -- 
>> 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/11430740-d840-4143-8c3a-67f0054bc92e%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/4aaac5dd-51ed-4a0d-944a-495281735682%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gallery App in Django project

2014-05-08 Thread m1chael
photologue may work for you.. i use it, and have customized it very
extensively for my needs

On Thu, May 8, 2014 at 3:05 AM, bradford li  wrote:
> I'm pretty new to Django and I thought, what better way to learn than to
> create your own website?!
>
> I posted a question on Stackoverflow.
>
> http://stackoverflow.com/questions/23534170/album-app-process-in-django
>
> I want to create a Gallery App that would display a list of albums. These
> albums would have a thumbnail of the first picture. Once the album is
> clicked, the photos would be displayed on the same url. From what I've
> learned I think this requires an AJAX request. I'm pretty new to web
> development. =/
>
> I know how to put an image onto a page however categorizing images and
> giving them properties and also display many of them at once without hard
> coding is something I have not learned yet. I need a bit of help doing this.
> I'm not sure of the process or best practices to do so. Any help is much
> appreciated 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/e0628382-3eea-44c5-bcb1-2720f36b05b1%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/CAAuoY6Py6TkVam0KZpeyNwUkJ6-R%2BnK1GyvRX1eY2Wp8_LcNEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


active/alive Calendar app options for Django

2014-05-08 Thread Adam Teale
Hi guys,

Quick question, anyone using or know of a calendar app that is currently in 
active development that i could use in my django app?

I've been trying to get django-swingtime and django_bootstrap_calendar but 
i've got errors that i can't seem to resolve and i think their dev on 
github might not be very active.

Ideally i'd like to implement something as cool as iCal / Google calendar - 
with dragable objects to set the start and end times

Thanks for any tips!

Adam

-- 
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/94bc7f15-97f2-425f-8c43-1c1719518133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z
outside the if statement the data appears..

-- 
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/757311fb-27a6-439b-af1b-5b381ebd7181%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z


   {% for e in customers %}
{% for d in vms %}
{% if e.id = d.CUSTOMERID %}
 {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }}
 
{% endif %}
{% endfor %}
{% endfor %}

why doesn't this work.?

-- 
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/588b09b2-7dfb-4e79-bb35-4de0741a5b00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Tutor] PyCountry currency formatting woes

2014-05-08 Thread Sithembewena Lloyd Dube
Thank you all, babel works just fine. I also tried ccy, which isn't bad
either - except that it returns non-unicode currency letters for countries
in the Eurozone.


On Mon, May 5, 2014 at 10:10 AM, Peter Otten <__pete...@web.de> wrote:

> Sithembewena Lloyd Dube wrote:
>
> > Thanks, i was actually getting the error information to update the post.
> > Apoligies to waste your time posting here - I could not find an
> > appropriate PyCountry discussion list and my next best bet seemed to be a
> > Python users' list.
> >
> > For those who care to look, the error is as follows (a concise example
> > from an interactive shell:
> >
> > import pycountry
> > country = pycountry.countries.get(alpha2='DE')
> > currency = pycountry.currencies.get(numeric=country.numeric)
> > Traceback (most recent call last):
> > File "", line 1, in
> > File "/usr/lib/pymodules/python2.6/pycountry/db.py", line 83, in get
> > return self.indices[field][value]
> > KeyError: '276'
> >
> > The obvious issue here is that the pycountry.countries collection does
> not
> > contain a currency with a numeric of 276 (Germany's numeric) - yet it
> does
> > contain the Euro. Any ideas as to what the way around this may be?
>
> It looks like the development version of babel
>
>
> http://babel.pocoo.org/docs/api/numbers/#babel.numbers.get_territory_currencies
>
> can do what you want:
>
> $ LANG=en_US.UTF-8 python
> Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
> [GCC 4.8.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import babel.numbers as bn
> >>> bn.get_territory_currencies("DE")
> ['EUR']
> >>> print bn.format_currency(1.234, "EUR")
> €1.23
> >>> print bn.format_currency(1.234, "EUR", locale="DE")
> 1,23 €
> >>> import babel
> >>> babel.__version__
> '2.0-dev'
>
> ___
> Tutor maillist  -  tu...@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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/CAH-SnCDmUJPseY7q27xifgkaKJou5Xbvo5_OWf-DFBsrP85m0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How would you do this cleanly in Django (remembering the states of check boxes in multiple pages)

2014-05-08 Thread François Schiettecatte
I would create a number of DIVs, put 100 production in each DIV and then 
show/hide the DIVs as needed using some javascript (like JQuery)

François

On May 8, 2014, at 9:18 AM, Chi-Cheong Weng  wrote:

> Hi guys,
> 
> I have been using Django for a little more than a year now, but I still 
> cannot think of a clean way of achieving this:
> 
> Let's say I have 1000 products in the db and I want to create a campaign to 
> promote the products. I am displaying the products 100 items each time and 
> each item has a check box. I want to be able to go back and forth between 
> different pages to select products and then when I hit the submit button, the 
> server will know what products I select.
> 
> How would you do this? Will you use other technology stack such as ajax, 
> jquery, etc?
> 
> 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/3b7c61b7-647e-48c9-907a-3a52dad7c183%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Django ChoiceField usage

2014-05-08 Thread sravani v
Hi,

I am new to Django. I am trying to working out on the different fields in 
this. From that only I found there are model fields and form fields existed 
in it. Now I am working on radio buttons. 
For this what I have done is,created a model with field 
"title = models.CharField(max_length=3, choices=TITLE_CHOICES)" 

and defined the choices as well. and in the forms.py did 
"title = forms.ChoiceField(choices=TITLE_CHOICES, 
widget=forms.RadioSelect())".

Finally it shows the title input as list only. Radiobuttons widget not 
working here.

Please do help

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/d4d2c537-95ff-4226-a829-e83a945b17e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How would you do this cleanly in Django (remembering the states of check boxes in multiple pages)

2014-05-08 Thread Chi-Cheong Weng
Hi guys,

I have been using Django for a little more than a year now, but I still 
cannot think of a clean way of achieving this:

Let's say I have 1000 products in the db and I want to create a campaign to 
promote the products. I am displaying the products 100 items each time and 
each item has a check box. I want to be able to go back and forth between 
different pages to select products and then when I hit the submit button, 
the server will know what products I select.

How would you do this? Will you use other technology stack such as ajax, 
jquery, etc?

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/3b7c61b7-647e-48c9-907a-3a52dad7c183%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Action without URL

2014-05-08 Thread Karino Kang
Thank you all, I will check documentation for using Django with AJAX.

Regards,
Karino KANG

Le jeudi 8 mai 2014 14:08:30 UTC+2, Stodge a écrit :
>
> Yes it is possible - think of the actions that need to take place.
>
>  * The user clicks the button in the browser.
>  * The browser sends an Ajax request to Django
>  * The Django view processes the Ajax request, updates the database and 
> sends a response to the browser
>
> These are web fundamentals and I think you need to do some reading on the 
> basic server/client architecture.
>
> On Thursday, 8 May 2014 07:35:22 UTC-4, Karino Kang wrote:
>>
>> Dear all,
>>
>> I'm a relatively new user of Django and I'm struggling to do something 
>> I'm not sure is possible with Django.
>>
>> I wanted to develop a "like" app which act pretty much like the facebook 
>> "like" except that you can dislike.
>>
>> My main problem is that I want to have a button or image for liking and 
>> disliking and I want to execute an action only in the database.
>>
>> for example, for the like, I would have something in the template like :
>>
>> 
>>
>> And I would have a python function defined somewhere in the app which 
>> would be the following :
>>
>> def like(model):
>> like_object = Like.objects.get(model=model, model_id=model_id)
>>
>> if like_object:
>> like_object = Like(model=model, model_id=model_id, like_count=1)
>>
>> like_object.like_count = like_count + 1
>> like_object.save()
>>
>>
>> I want this action to be executed when I click on the image like.png but 
>> I don't want the page to be change. There will be a like count displayed on 
>> the page but it will be updated using javascript.
>>
>> Is this possible with Django?
>>
>> Regards,
>> Karino KANG
>>
>

-- 
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/308258ea-c860-4fd9-a03f-79b1dedc182f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Action without URL

2014-05-08 Thread Stodge
Yes it is possible - think of the actions that need to take place.

 * The user clicks the button in the browser.
 * The browser sends an Ajax request to Django
 * The Django view processes the Ajax request, updates the database and 
sends a response to the browser

These are web fundamentals and I think you need to do some reading on the 
basic server/client architecture.

On Thursday, 8 May 2014 07:35:22 UTC-4, Karino Kang wrote:
>
> Dear all,
>
> I'm a relatively new user of Django and I'm struggling to do something I'm 
> not sure is possible with Django.
>
> I wanted to develop a "like" app which act pretty much like the facebook 
> "like" except that you can dislike.
>
> My main problem is that I want to have a button or image for liking and 
> disliking and I want to execute an action only in the database.
>
> for example, for the like, I would have something in the template like :
>
> 
>
> And I would have a python function defined somewhere in the app which 
> would be the following :
>
> def like(model):
> like_object = Like.objects.get(model=model, model_id=model_id)
>
> if like_object:
> like_object = Like(model=model, model_id=model_id, like_count=1)
>
> like_object.like_count = like_count + 1
> like_object.save()
>
>
> I want this action to be executed when I click on the image like.png but I 
> don't want the page to be change. There will be a like count displayed on 
> the page but it will be updated using javascript.
>
> Is this possible with Django?
>
> Regards,
> Karino KANG
>

-- 
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/6617bea8-4939-4d2f-9dbe-fb103aaa18da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Action without URL

2014-05-08 Thread Daniel Roseman
On Thursday, 8 May 2014 12:35:22 UTC+1, Karino Kang wrote:
>
> Dear all,
>
> I'm a relatively new user of Django and I'm struggling to do something I'm 
> not sure is possible with Django.
>
> I wanted to develop a "like" app which act pretty much like the facebook 
> "like" except that you can dislike.
>
> My main problem is that I want to have a button or image for liking and 
> disliking and I want to execute an action only in the database.
>
> for example, for the like, I would have something in the template like :
>
> 
>
> And I would have a python function defined somewhere in the app which 
> would be the following :
>
> def like(model):
> like_object = Like.objects.get(model=model, model_id=model_id)
>
> if like_object:
> like_object = Like(model=model, model_id=model_id, like_count=1)
>
> like_object.like_count = like_count + 1
> like_object.save()
>
>
> I want this action to be executed when I click on the image like.png but I 
> don't want the page to be change. There will be a like count displayed on 
> the page but it will be updated using javascript.
>
> Is this possible with Django?
>
> Regards,
> Karino KANG
>


Why would it not be possible? You are already aware that this needs to use 
Javascript, ie Ajax. Django won't do anything to stop you from making an 
Ajax request to update the counter.
--
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/a4dc15f4-3fe1-4334-9c32-e1324a6f1a90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Action without URL

2014-05-08 Thread Karino Kang
Dear all,

I'm a relatively new user of Django and I'm struggling to do something I'm 
not sure is possible with Django.

I wanted to develop a "like" app which act pretty much like the facebook 
"like" except that you can dislike.

My main problem is that I want to have a button or image for liking and 
disliking and I want to execute an action only in the database.

for example, for the like, I would have something in the template like :



And I would have a python function defined somewhere in the app which would 
be the following :

def like(model):
like_object = Like.objects.get(model=model, model_id=model_id)

if like_object:
like_object = Like(model=model, model_id=model_id, like_count=1)

like_object.like_count = like_count + 1
like_object.save()


I want this action to be executed when I click on the image like.png but I 
don't want the page to be change. There will be a like count displayed on 
the page but it will be updated using javascript.

Is this possible with Django?

Regards,
Karino KANG

-- 
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/f80e0b7a-fa72-4f2d-a02b-b7d64fd71687%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django app called operator

2014-05-08 Thread Domagoj Kovač
Thanks Tom, i thought something like this has happened.

-- 
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/5c630882-5ab7-41a9-b3b5-007981b23bbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Gallery App process

2014-05-08 Thread bradford li


I want to know how to display images separated by albums onto a page in 
Django. So far, I've learned how to do so with the line



in my html file.

What I want to do is have a few album thumbnails out and upon click, all 
the images from the album should be displayed. I believe I would do this 
with an AJAX request. I am probably going to categorized these photos with 
tags and put names one them and other characteristics.

I am new to Django so I am not sure where and how to start with this app of 
mine. Could someone lend me a hand and propose a method ot guideline on how 
to do so? Much appreciated!

-- 
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/c8c1ed72-83be-4bba-8bad-5116d36b62c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Gallery App in Django project

2014-05-08 Thread bradford li
I'm pretty new to Django and I thought, what better way to learn than to 
create your own website?!

I posted a question on Stackoverflow.

http://stackoverflow.com/questions/23534170/album-app-process-in-django

I want to create a Gallery App that would display a list of albums. These 
albums would have a thumbnail of the first picture. Once the album is 
clicked, the photos would be displayed on the same url. From what I've 
learned I think this requires an AJAX request. I'm pretty new to web 
development. =/ 

I know how to put an image onto a page however categorizing images and 
giving them properties and also display many of them at once without hard 
coding is something I have not learned yet. I need a bit of help doing 
this. I'm not sure of the process or best practices to do so. Any help is 
much appreciated 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/e0628382-3eea-44c5-bcb1-2720f36b05b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django app called operator

2014-05-08 Thread Tom Evans
On Thu, May 8, 2014 at 11:48 AM, Domagoj Kovač  wrote:
> Hi everybody,
>
> I have a problem. In my settings i have:
>
>> INSTALLED_APPS = (
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> # Uncomment the next line to enable the admin:
>> 'django.contrib.admin',
>> # Uncomment the next line to enable admin documentation:
>> # 'django.contrib.admindocs',
>> 'south',
>> 'gunicorn',
>> 'core',
>> 'operator',
>> 'replication',
>> 'service',
>> 'system_configuration',
>> 'target',
>> )
>
>
> There is an application called operator. If i try to run my server this way
> i get an error:
>
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 399, in execute_from_command_line
>> utility.execute()
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 392, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 242, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 280, in execute
>> translation.activate('en-us')
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>> line 130, in activate
>> return _trans.activate(language)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 188, in activate
>> _active.value = translation(language)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 177, in translation
>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 160, in _fetch
>> apppath = os.path.join(os.path.dirname(upath(app.__file__)), 'locale')
>> AttributeError: 'module' object has no attribute '__file__'
>
>
> If i change operator to operater or something else everything works properly
> i get no errors. Did anyone had similar problem before?

"operator" is the name of a python system library, you cannot use it
as an app name easily.

You would have identical problems if you used the app name "os" or
"tempfile" or "hashlib" or pretty much any name on this page:

https://docs.python.org/2/library/index.html

Use a different name!

Cheers

Tom

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


Django app called operator

2014-05-08 Thread Domagoj Kovač
Hi everybody,

I have a problem. In my settings i have: 

INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'south',
> 'gunicorn',
> 'core',
> 'operator',
> 'replication',
> 'service',
> 'system_configuration',
> 'target',
> )


There is an application called operator. If i try to run my server this way 
i get an error:

Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 399, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 280, in execute
> translation.activate('en-us')
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>  
> line 130, in activate
> return _trans.activate(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 188, in activate
> _active.value = translation(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 160, in _fetch
> apppath = os.path.join(os.path.dirname(upath(app.__file__)), 'locale')
> AttributeError: 'module' object has no attribute '__file__'


If i change operator to operater or something else everything works 
properly i get no errors. Did anyone had similar problem before? 

-- 
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/2c97ae44-527c-4b49-a446-ef707beba861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is different of handling character code between pure Python and Django?

2014-05-08 Thread Tom Evans
On Thu, May 8, 2014 at 5:05 AM, Sugita Shinsuke  wrote:
> Hello Tom Evans
>
>
>> plain single and double quotes - " and ', not “ and ‘.
> My e-mail client is Gmail web client.
>
>>What version of Python? 2.x or 3.x?
> Python version is 2.7.5
> And, Django version is 1.3.7

Django 1.3.7 is very old, it has known security holes in it and is not
maintained. What I talk about from here on down is not relevant for
1.3 - upgrade to at least 1.6.

In Python 2, you should mark your strings as unicode if they contain
anything other than ascii.

  u'This is a unicode string'

 'This is a byte string'

The characters within the string should be in the encoding specified
for the current file. See:

https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code

Unicode strings are converted to the correct encoding for your
environment when output (running a command "outputs" the string to the
shell).

So, if you want your management command to output UTF-8:

1) Mark the strings in your program as unicode
2) Mark the files containing unicode string literals to denote the
character encoding used by the string literals
3) Ensure the environment that django is run in has the locale
correctly specified.
4) Ensure your management command either:
  a) Activates a fixed language prior to outputting unicode or
  b) Instructs django to use locale from the environment
  See 
https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/#management-commands-and-locales

Cheers

Tom

>
>>There was an old case to force Django to use UTF-8:
> I added
> sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
> But, I couldn't resolve...
>
>>language that user requests (if supported and USE_i18N=True) or
> LANGUAGE_CODE otherwise.
>
> Both of them are True.
> USE_I18N = True
> USE_L10N = True
>
>
> 2014年5月8日木曜日 1時23分01秒 UTC+9 Tom Evans:
>>
>> On Sun, Apr 27, 2014 at 7:13 AM, Sugita Shinsuke 
>> wrote:
>> > Hi there
>> >
>> > I’d like to run Java code via Django.
>> >
>> > The Java code, javaprogram use like below.
>> >
>> > —
>> > java javaprogram [text] [file_name]
>> > —
>> >
>> > text is parameter. multi-byte character is also okey.
>> > file_name is generate file name.
>> >
>> > So, I run the stand-alone Python program like below could run fine.
>> > —
>> > java_file = ‘javaprogram’
>> > file_name = ‘filename’
>> > text = ‘あいうえお’ #Japanese character
>> > java_file_path = ‘/path/to/‘
>> > class_path = ‘-cp ' + java_file_path
>> >
>> > cmd = “java {0} {1} {2} {3}".format(class_path, java_file, text,
>> > file_name)
>>
>> What version of Python? 2.x or 3.x?
>>
>> Presumably your email client is converting plain single and double
>> quotes to smart quotes and backticks, and in your source code they are
>> plain single and double quotes - " and ', not “ and ‘.
>>
>> Django does something explicitly to force management commands to be
>> ascii, see here:
>>
>>
>> https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/#management-commands-and-locales
>>
>> There was an old case to force Django to use UTF-8:
>> https://code.djangoproject.com/ticket/5877
>>
>> It was closed wontfix on the basis that Django respects your locale,
>> which it no longer does by default. There are several workarounds
>> listed on the first link that will restore that behaviour. Within a
>> view code, the rules are different, it will activate either the
>> language that user requests (if supported and USE_i18N=True) or
>> LANGUAGE_CODE otherwise.
>>
>> Cheers
>>
>> Tom

-- 
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/CAFHbX1LU%2B8CfePtBbcY%3Dg-o_bM8Peri9oazTv6YOW8U6kGBcMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Splitting field in Django admin “Add” interface into its constituent fields

2014-05-08 Thread kmclifton


Hi,

I already asked this on stackoverflow 
(http://stackoverflow.com/questions/23534608/splitting-field-in-django-admin-add-interface-into-its-constituent-fields).
 
 Thought I would ask here too.

I am using Django 1.6. In the "Add" interface for one of my models, I have 
a field that is a foreign key to another model. Therefore it is displayed 
as a dropdown box containing the string representation of the second model. 
I want to be able to split it up into its constituent fields instead. Is 
there a way to do this?

ie. For example, in my "Add" screen for the model for "User", I have a 
field "Favourite Book". "Book" is displayed as a dropdown menu with string 
representations "Title, Author" for all books in the database, and I want 
to be able to display two dropdown menus instead, one for each of the 
fields Title and Author.

Thanks,

Kristen



-- 
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/788ce601-3f37-4274-bbde-3d1eb65815fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.