Re: How to make django's mysql connections to use utf8mb4 ?

2013-01-23 Thread Adrián Espinosa
Hello, I struggled with this once, although not through Django. I tried a lot of things, and I couldn't get MySQL to properly store emojis, or japanese/chinese characters for example. As my project was just starting, I switched to postgresql, and it just worked. I did nothing fancy to get it

Re: Generic views and url issues

2013-01-23 Thread mgc_django-users
On 24/01/2013 10:39 AM, amy.cerr...@cbsinteractive.com wrote: I've been trying to understand how to use generic views. I've followed some tutorials, and read through Django docs, but I can't get the url function to work in my templates. I get the error NoReverseMatch at /testadcall/ Reverse

Re: Generic views and url issues

2013-01-23 Thread Sanjay Bhangar
(reply inline) On Thu, Jan 24, 2013 at 5:09 AM, wrote: > I've been trying to understand how to use generic views. I've followed some > tutorials, and read through Django docs, but I can't get the url function to > work in my templates. > > I get the error >

Re: What's the right pattern to re-use common view code?

2013-01-23 Thread Derek
If you'd read the Django Book (IMO, an essential "before you start with Django" read), you would have encountered the include tag in Chpt 4, the introduction to the templates: http://www.djangobook.com/en/2.0/chapter04.html On Tuesday, 22 January 2013 23:51:53 UTC+2, andrew jackson wrote: > >

Re: Generic views and url issues

2013-01-23 Thread Sergiy Khohlov
try to check testaddcall/1/ please Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/24 : > I've been trying to understand how to use generic views. I've followed some > tutorials, and read through Django docs, but I can't get the url function to >

Re: Relations to unknown models?

2013-01-23 Thread jirka . vejrazka
Hi galgal, You might want to take a look at django.contrib.comments (either use it or learn from it) and/or GenericForeignKey. HTH Jirka -Original Message- From: galgal Sender: django-users@googlegroups.com Date: Wed, 23 Jan 2013 14:48:55 To:

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
On 24/01/2013 10:46am, frocco wrote: Thanks Mike, I do not know if this will work. I want to change the field in the template as I read each row. I do this in PHP rather easy, but am confused on how to do this using django. I haven't done much php (only emergency repairs to stuff written by

Generic views and url issues

2013-01-23 Thread amy . cerrito
I've been trying to understand how to use generic views. I've followed some tutorials, and read through Django docs, but I can't get the url function to work in my templates. I get the error NoReverseMatch at /testadcall/ Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}'

Re: how do I dynamically modify a choice field

2013-01-23 Thread frocco
Thanks Mike, I do not know if this will work. I want to change the field in the template as I read each row. I do this in PHP rather easy, but am confused on how to do this using django. On Wednesday, January 23, 2013 6:03:28 PM UTC-5, Mike Dewhirst wrote: > > On 24/01/2013 2:36am, frocco

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
On 24/01/2013 2:36am, frocco wrote: Hello, In my view, I am displaying rows of data that have a choice field in a form. one form for each row I want to change the choice this before printing. one row can have 1 to 5 choices another row can have 1 to 10 choices depending on values in each row.

Relations to unknown models?

2013-01-23 Thread galgal
Hi. I'm looking for a solution to make site-wide comments that can be connected with different models via FK. I want to make 1 global model Comments. I want to make a relation to Articles, Relations and Solutions models. I the future I plan to add additional models. Now, Comments model should

How can i redirect a form to amother page when validation is correct

2013-01-23 Thread Okorie Emmanuel
Am trying to build an application that user can login to register using pin and serial number from a scratch card, a valid pin and serial number should take a user to the registration page to create an account, here are codes i have writen *view.py* def index(request,

How to make django's mysql connections to use utf8mb4 ?

2013-01-23 Thread Chen Xu
I saved some Emoji icons to MySQL Database,the icons have been saved correctly. Since I can see them from MySQL Shell when I type 'select message_text from messages' However, when I do Message.object.get(ph=5).message_text, it shows me a bunch question marks. Could someone please help? Thanks

Re: no attribute JSONEncoder

2013-01-23 Thread ghjim
No, I rebuilt mod_wsgi with the new Python2.7.3. On Wednesday, January 23, 2013 12:15:50 PM UTC-8, Nikolas Stevenson-Molnar wrote: > > Are you sure that mod_wsgi was built against Python 2.7 (you may have 2.7 > installed on your system, but mod_wsgi may be using an older version). Did > you

Re: no attribute JSONEncoder

2013-01-23 Thread Nikolas Stevenson-Molnar
Are you sure that mod_wsgi was built against Python 2.7 (you may have 2.7 installed on your system, but mod_wsgi may be using an older version). Did you use a pre-built mod_wsgi or did you build it yourself? _Nik On 1/23/2013 8:08 AM, ghjim wrote: > The dev server works fine. This only happens

Re: Upload multiple files using Ajax

2013-01-23 Thread Barry Morrison
I created this https://github.com/esacteksab/django-jquery-file-upload which is just jQuery-File-Upload ported to Django. It was a fork of someone elses' project that addressed my needs (support for models) On Wednesday, January 23, 2013 2:18:01 AM UTC-8, psjinx wrote: > > You can use

Re: Django-SEO issue

2013-01-23 Thread Jeff Ammons
Looks like a bug or partial implementation issue. I just submitted a pull request, so hopefully it'll get accepted quickly. https://github.com/willhardy/django-seo/pull/35 -Jeff On Tuesday, January 22, 2013 1:36:54 PM UTC-7, jondbaker wrote: > > I wasn't. If anyone has a solution I'd still be

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-23 Thread Tomas Neme
> I don`t understand that.. in my form, I don't have the request, or I have? > > I know I have request in my view, but I need to pass UserProfile to my form, > but inlineformset_factory doesn't accept to pass vUserProfile as parameter, > even I modified __init__ to get this parameter. OK, so

Re: no attribute JSONEncoder

2013-01-23 Thread ghjim
The dev server works fine. This only happens in my production server via mod_wsgi. On Monday, January 21, 2013 8:26:06 PM UTC-8, Nikolas Stevenson-Molnar wrote: > > Does this happen only in production running via mod_wsgi, or does it > happen in local development with the Django dev server

how do I dynamically modify a choice field

2013-01-23 Thread frocco
Hello, In my view, I am displaying rows of data that have a choice field in a form. one form for each row I want to change the choice this before printing. one row can have 1 to 5 choices another row can have 1 to 10 choices depending on values in each row. -- You received this message

Re: BigAutoField

2013-01-23 Thread SteveB
Yes, I'll post it there. Thanks, Steve On Wednesday, 23 January 2013 13:40:44 UTC, psjinx wrote: > > Hey Steve, > > You should ask this questions in django-developers mailing list as > it's related to development of django itself. It will be best to hear > comments from Core Developers. > >

Re: how do I code sql using the raw method?

2013-01-23 Thread frocco
Nevermind, I got this working. On Wednesday, January 23, 2013 9:13:46 AM UTC-5, frocco wrote: > > Hello, > > I need to code a select statement based on a dynamic field. > > select price_a as price from table > > def return priceLevel(x): > if x == 'A': return 'price_a' > if x == 'B': return

how do I code sql using the raw method?

2013-01-23 Thread frocco
Hello, I need to code a select statement based on a dynamic field. select price_a as price from table def return priceLevel(x): if x == 'A': return 'price_a' if x == 'B': return 'price_b' if x == 'C': return 'price_c' so my sql would be: fld = priceLevel('B') select fld as price from table I

Re: interplay between django and twitter-bootstrap...

2013-01-23 Thread Sameer Oak
Hello Pankaj, This is much of a help from you. Thank you very much for you help. Regards, - sameer oak. On Wed, Jan 23, 2013 at 7:07 PM, Pankaj Singh wrote: > Hey Sameer, > > Django gives you complete freedom for choosing client side libraries. > You can easily use

RE: Newbee: Unable to change the date because Calender won't

2013-01-23 Thread Babatunde Akinyanmi
POP-UP as said in Tutorial MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_Part_397_27447967.1358923165638" --=_Part_397_27447967.1358923165638 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Is JavaScript activated? Sent

Re: BigAutoField

2013-01-23 Thread Pankaj Singh
Hey Steve, You should ask this questions in django-developers mailing list as it's related to development of django itself. It will be best to hear comments from Core Developers. -- Pankaj Singh http://about.me/psjinx On Wed, Jan 23, 2013 at 6:58 PM, SteveB wrote: > Can

Re: interplay between django and twitter-bootstrap...

2013-01-23 Thread Pankaj Singh
Hey Sameer, Django gives you complete freedom for choosing client side libraries. You can easily use twitter-bootstrap in django templates. There are many libraries written using django and bootstrap to create beautiful forms. Here are some example - 1.

BigAutoField

2013-01-23 Thread SteveB
Can anybody provide an update on the request to define a BigAutoField in Django? We could really use this model field type without having to do workarounds and customizations. Can any of the Django developers comment on when this will be released? Thanks, Steve -- You received this message

Re: django admin - changelist view: keep selected items on multiple pages

2013-01-23 Thread Pankaj Singh
Hey Luke, This is not related to link you mentioned. That link only talks about `How to customize the admin change list`. You can achieve what you want using cookies. Please have a look at similar question

Re: django-registration-template

2013-01-23 Thread Pankaj Singh
Hey Sameer, His project uses twitter bootstrap forms in templates. That's the only unique thing about this project. If you are looking for an email based registration app in django which uses bootstrap forms then you can use this one. -- Pankaj Singh http://about.me/psjinx On Wed, Jan 23,

Custom storage question

2013-01-23 Thread Bart Grantham
Hello, I'm working on a project that has specific, but not terribly complex, file management needs and I think I may need to write a custom Storage backend. But I'm not totally sure, so let me explain my problem before I ask any specific questions. I am migrating a large set of files into

Re: django-registration-template

2013-01-23 Thread SameerOak
Hello, Sorry if you find my question too foolish or naive. Actually, I don't have any web development experience and this is the first time I'm trying to learn django and twitter-bootstrap. While searching on the forum for a solution about how to use twitter-bootstrap on the client side while

django admin - changelist view: keep selected items on multiple pages

2013-01-23 Thread luke lukes
a question about admin: in the changelist page, is it possible to keep the selected items of a page while going to another page and returning to it. I mean: 1. I'm on the page 1; 2. I select some

django admin: keeping selected items on different page in changelist view

2013-01-23 Thread luke lukes
Hi everyone. a question about admin: in the changelist page, is it possible to keep the selected items of a page while going to another page and returning to it. I mean: 1. I'm on the page 1; 2. I select some items; 3. then i go to page 2; 4. I select other items; 5. I return

Re: django<-->twitter bootstrap philosophy

2013-01-23 Thread SameerOak
Hello Vincent, I'm also a new comer to the web-2.0 world. After almost 12+ years of experience in developing enterprise level products in pure C on Linux and a lot of bash shell scripting, I thought I'd start something new. So I left job, 25-Jan-2013 being the last day. It's better late than

Newbee: Unable to change the date because Calender won't POP-UP as said in Tutorial

2013-01-23 Thread Shiva MSK
Hello Friends, I am new to the Django and right now i am doing "Writing Your First Django app" .In the tutorial , it was said "Each DateTimeField gets free JavaScript shortcuts. Dates get a “Today” shortcut and calendar popup, and times get a “Now” shortcut and a

interplay between django and twitter-bootstrap...

2013-01-23 Thread SameerOak
Hello, I am new to web development and python and django was my immediate choice to start with. I am in a process of developing a moderated traffic portal. Coming straight to the query, can I design my web pages using twitter-bootstrap and django framework in the back-end? Kindly help.

Re: ignore field during form validation

2013-01-23 Thread Sarfraz ahmad
def clean_A6M1F6_F(self): data=self.cleaned_data['A6M1F6_F'] if A6M1_mobile.objects.filter(A6M1F6=data).exists(): raise forms.ValidationError(" already exixts") return data i have this clean_field method in the form and given field is not updatable...

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Sarfraz ahmad
items = request.user. a11m1_user_itmes_set.all() works correctly thank you buddies On Wed, Jan 23, 2013 at 4:40 PM, Rafael E. Ferrero wrote: > Sorry, but select_related() dont work for you?? > > > 2013/1/23 Pankaj Singh > >> items = request.user.

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Rafael E. Ferrero
Sorry, but select_related() dont work for you?? 2013/1/23 Pankaj Singh > items = request.user. a11m1_user_itmes_set.all() > > is equivalent to > > items = A11M1_user_itmes.objects.filter(user=request.user) > > `items` will contain all items A11M1_user_itmes related to

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
items = request.user. a11m1_user_itmes_set.all() is equivalent to items = A11M1_user_itmes.objects.filter(user=request.user) `items` will contain all items A11M1_user_itmes related to currently logged in user. Now, if you want to get `content_object` for a particular item, do something like

Re: download pdf in admin

2013-01-23 Thread Pankaj Singh
Hey Milan, Uploaded files are available at `MEDIA_URL` which is generally set to `/media`. So if you enable serving for media files, then your file should be available at http://127.0.0.1:8000/media/scany/2013/01/21/hrebci.pdf Please have a look at official documentation for this,

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-23 Thread Fellipe Henrique
I don`t understand that.. in my form, I don't have the request, or I have? I know I have request in my view, but I need to pass UserProfile to my form, but inlineformset_factory doesn't accept to pass vUserProfile as parameter, even I modified __init__ to get this parameter. Here is my form

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Sarfraz ahmad
i dont found any query related to this model bro On Wed, Jan 23, 2013 at 4:01 PM, Pankaj Singh wrote: > If you want to get all `A11M1_user_items` objects then following query > should work > > > -- > Pankaj Singh > http://about.me/psjinx > > > On Wed, Jan 23, 2013 at

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
Sorry for last reply. I sent uncompleted email by mistake, while looking at other laptop. If you want to get all `A11M1_user_itmes ` objects then following query should work objects = request.user. a11m1_user_itmes_set.all() You can use `content_object` attribute on each object in objects list

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
If you want to get all `A11M1_user_items` objects then following query should work -- Pankaj Singh http://about.me/psjinx On Wed, Jan 23, 2013 at 3:53 PM, Sarfraz ahmad wrote: > i have the same model having one foreignkey to User and second to the > ContentType > >

Re: Where can I put code that will get executed when page refreshes

2013-01-23 Thread Pankaj Singh
Hey, You must be using a context variable to fill your `side_menu` block. One reason for failure can be that, context variable is available in template when `ntw.views.index` is called but not available when 'staff.views.index' is called. -- Pankaj Singh http://about.me/psjinx On Tue, Jan 22,

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Sarfraz ahmad
i have the same model having one foreignkey to User and second to the ContentType class A11M1_user_itmes(models.Model): A11M1F1_user=models.ForeignKey(User) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object =

Re: Upload multiple files using Ajax

2013-01-23 Thread Pankaj Singh
You can use https://github.com/blueimp/jQuery-File-Upload. You can use a view function similar to following. Here I have 3 models - Project, Album and Flat A Project can have multiple albums. An Album can have multiple Flats A Flat has an ImageField, caption as TextField and a ForeignKey to

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
So, you have a custom model like following class MyModel(models.Model): ... content_type = models.ForeignKey(ContentType) ... And you want to run a query on MyModel which should return objects from various apps related to currently logged in User. Is this what you want to achieve?

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Sarfraz ahmad
thanx buddy bt i wish to do it in a manner that a model which has a foreign key to ContentType, when i make a query on this model it returns all the objects from various apps related to current logged in user On Wed, Jan 23, 2013 at 3:00 PM, Pankaj Singh wrote: > Hey

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
Hey Sarfraz, If you have an user object, then you can get all related objects using following code user = User.objects.get(username="psjinx") related_links = [rel.get_accessor_name() for rel in user._meta.get_all_related_objects()] ## above code will give a list of attribute names for each

Re: how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Pankaj Singh
Hey Sarfraz, You can use any of following methods: User._meta.get_all_related_m2m_objects_with_model() User._meta.get_all_related_objects() User._meta.get_all_related_many_to_many_objects() User._meta.get_all_related_objects_with_model() get_all_related_objects() is the one I guess you may want

how to get all objects related to a particular user using django ContentType Framework

2013-01-23 Thread Sarfraz ahmad
hello friends i have a project with 7 applications installed in it and i want to get all the objects related to a particular user from all the applications of ma project. please tell me how can i get all these objects using ContentType framework thank you all --