Re: What all does pinax provides us once you have used a starter project ?

2012-05-19 Thread yugal
I am still not satisfied with the answer I got.. So, is the starter project 
all that pinax provides ?


On Saturday, 19 May 2012 18:51:17 UTC+5:30, yugal wrote:
>
>
> I am confused as I have a starter project with Pinax and it seems its over.
>
> I have mentioned my whole scenario in 
> http://stackoverflow.com/q/10569310/731963
>
> Please elaborate and share your experiences with pinax !
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pwQGvGwWX4kJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-19 Thread Matt Schinckel
You may be able to use prefetch_related to do what you want: it will all 
depend upon your model structure. select_related is easier, but only 
follows an fk in one direction.

Matt.

On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote:
>
> Hi,
>
> again, my models are Customer, Users and Devices.
>
> I would like to search by Customer and retrieve all 'select_related' rows 
> of all the three models.
> Eg. like this..
>
> Customer1 User1 Device1
> Customer1 User1 Device2
> Customer1 User2 Device1
> Customer1 User2 Device2
> etc etc..
>
> Is this possible in Django? If so how?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QJ87PppeEKcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bash error when trying to django_admin.py; not found -- FAQ not helping

2012-05-19 Thread Mario Gudelj
Hey Mike,

If you go to Python shell and do "import django", do you get an error
message and what is it?

Also, the location of 2.7 is different to other versions. They used to be
under /Library/Python/.. and 2.7 is under /System/Library/.. so you may
want to check your paths.

Also, try installing with "sudo easy_install django". I think that's what I
used on my Mac and it worked.

Cheers,

-m




Also, make sure that the python version loaded is 2.7.

On 20 May 2012 08:02, Mike Manfrin  wrote:

> I just installed django 1.4 on my OSX.7 macbook running Python 2.7.1.
>
> I installed first via git, and when that didn't work, I downloaded the
> tar and unzipped/installed 1.4.
>
> I am specifically getting the error:
> -bash: django_admin.py: command not found
>
> However, in /usr/local/bin, django_admin.py exists. When trying
> sudo ln -s /usr/local/python2.7/site-packages/django/bin/django-
> admin.py /usr/local/bin/django-admin.py
> as the FAQ suggests, I get an error saying /usr/local/bin/django-
> admin.py exists!
>
> So, I am running in to two errors: One saying django_admin doesn't
> exist, and the other saying it does when I try to set it up.
>
> I'm at the point of pulling out my hair -- any help would be
> appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django forms - overriding constructor for changing field type depending by input

2012-05-19 Thread Mario Gudelj
Hey Luke,

I don't think you need to return anything, especially not a super class.

Try this http://dpaste.com/hold/750356/

Cheers,

-m



On 20 May 2012 10:06, luke lukes  wrote:

> hi everyone. i need to overrid the constructor of a form: if i have some
> value in input, some fields has to be ChoiceField, otherwise they have to
> be CharField. here's the code:
>
> http://dpaste.com/750343/
>
> but this way doesn't work. even if i declare fields before constructor  as
> CharField and then I ovverride them in __init__, they will not be
> renderized in template (I got this message:
> ).I don't
> understand where's the mistake (also because i have poor python skills...)
>
> any help?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/lIzEfD5QeZMJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Yes you're right Marc!

It's just that I wanted to mention the fact my application is not only a
web site accessible via a web browser only, but a client-server application
with web-based GUI.

But now things are clear, we're all now ok with the problematic and with
your help and great responses, i noticed it's better to do all my system
communication based on HTTP.

I thank you for all your attention, all new ideas are still well come, and
i'll let you follow up the evelution of the development.

Thanks guys.



2012/5/20 Marc Aymerich 

> On Sat, May 19, 2012 at 8:01 PM, Eugène Ngontang 
> wrote:
> > Hi Jani.
> > I don't know why you say
> >
> > " 3) Are you now trying to figure out how to plug in Django in "Adming
> > module/PC with GUI block"?"
> >
> > My admin module and the gui do not share anything. They are not on the
> same
> > pc.
> > Gui is for displaying and admin for the page content management like any
> web
> > aplication works.
> >
> > I please us unot to build a myster arround this thread. The problem was
> > simple:
>
>
> HI Eugène,
> the problem was simple, but all we have misunderstood you because
> usually the term GUI is used to refer "desktop application" rather
> than a web page, which seems to be the case.
>
> br
> --
> Marc
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
ngont...@epitech.net
sympav...@gmail.com

*Aux hommes il faut un chef, et au** chef il faut des hommes!*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Marc Aymerich
On Sat, May 19, 2012 at 8:01 PM, Eugène Ngontang  wrote:
> Hi Jani.
> I don't know why you say
>
> " 3) Are you now trying to figure out how to plug in Django in "Adming
> module/PC with GUI block"?"
>
> My admin module and the gui do not share anything. They are not on the same
> pc.
> Gui is for displaying and admin for the page content management like any web
> aplication works.
>
> I please us unot to build a myster arround this thread. The problem was
> simple:


HI Eugène,
the problem was simple, but all we have misunderstood you because
usually the term GUI is used to refer "desktop application" rather
than a web page, which seems to be the case.

br
-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django forms - overriding constructor for changing field type depending by input

2012-05-19 Thread luke lukes
hi everyone. i need to overrid the constructor of a form: if i have some 
value in input, some fields has to be ChoiceField, otherwise they have to 
be CharField. here's the code:

http://dpaste.com/750343/

but this way doesn't work. even if i declare fields before constructor  as 
CharField and then I ovverride them in __init__, they will not be 
renderized in template (I got this message: 
).I don't 
understand where's the mistake (also because i have poor python skills...)

any help?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lIzEfD5QeZMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



My context variables don't show in templates

2012-05-19 Thread Mohamed Turki
Hi,

I have a view called home that searches for a user in my UserProfile model 
and returns the username. I add this
username to the context variable and try to show it in the template. Pretty 
straightforward and simple, right? 
Well, here is my code first :

def home(request):
var = ""
n = None
if request.method == u'GET':
GET = request.GET
if GET.has_key(u'name'):
n = GET[u'name']
try:
user = UserProfile.objects.get(facebookId = n)
user.is_active = True
user.last_login = datetime.now()
var = user.facebookId
user.save()

print var 


#on log out
if GET.has_key(u'logout'):
print 'im logging out!'
user = UserProfile.objects.get(facebookId = n)
user.is_active = False
user.last_login = datetime.now()
user.save()




except:
user = UserProfile(facebookId=n,playedHours=0, 
is_active=True)
user.save()


print var  
context  = {'nom':var}
return 
render_to_response('home.html',context,context_instance=RequestContext(request))


and in my template I have something as simple as :

{{ nom }}

However, when I replace *var* with a "bla bla bla" for example, it shows on 
my template, but when I pass a variable name to the 
context, it doesn't show ! I also can see the *var* value on my console 
(notice i'm using print twice or thrice in the code)

am I doing anything wrong here?

Thanks !












-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/fiNfWVrhf0AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-19 Thread DF
Perfect! That worked!

Thank you so much! I was stumped. Your revisions were much simpler and easy 
to understand as well. I really appreciate when I can learn something, 
especially a more straightforward process that is less complex and achieves 
the same desired results.

Thank you, again!

On Saturday, May 19, 2012 11:41:51 AM UTC-4, jondbaker wrote:
>
> OK, I spent some more time with this. Firstly, I've included a different 
> way to populate the author field. With this update, the ModelForm only 
> needs the following:
>
> # forms.py
> class StoryForm(forms.ModelForm):
> class Meta:
> model = Story
> exclude = ('author',)
>
> Next I simplified your views a little bit. When dealing with the .save() 
> method of a ModelForm, commit=True is the default. This allows you to use 
> commit=False, and then manually adjust attributes of the object, and then 
> save it when you're done. This is a great opportunity to save the author 
> field.
>
> # views.py
> @login_required
> def submit_story(request):
> if request.method =="POST":
> story_form = StoryForm(request.POST, request.FILES)
> if story_form.is_valid():
> new_story = story_form.save(commit=false)
> new_story.author = request.user
> new_story.save()
> return HttpResponseRedirect("/report/all/")
> else: # GET request
> story_form = StoryForm()
> return render_to_response("report/report.html", {'form': story_form}, 
> context_instance=RequestContext(request))
>
> @login_required
> def edit_story(request, story_id)
> story = get_object_or_404(Story, pk=story_id, author=request.user)
> if request.method == 'POST':
> story_form = StoryForm(request.POST, request.FILES, instance=story)
> if story_form.is_valid():
> story_form.save()
> return HttpResponseRedirect("/profiles/user_profile")
> else: # GET request
> story_form = StoryForm(instance=story)
> return render_to_response('report/storyedit.html', {'form': 
> story_form}, context_instance=RequestContext(request))
>
> I hope this helps a little.
> Jonathan
>
>
> On Fri, May 18, 2012 at 5:19 PM, DF  wrote:
>
>> Thanks. I get this error using that code:
>>
>> TypeError at /report/detail/30/edit/ 
>>
>> __init__() takes at least 2 arguments (1 given)
>>
>> This is referring to this line:
>>
>>   story_form = StoryForm(instance=story)
>>
>> I added a "story_id" argument to this, which brought up the form, but 
>> when I submitted it, it returned the form with errors listing all the 
>> fields as empty.
>>
>> This is far trickier than I thought.
>>
>>
>>
>> On Friday, May 18, 2012 7:01:25 PM UTC-4, jondbaker wrote:
>>>
>>> Hmmm... I don't think you need to pass 'request.user' in as an argument. 
>>> Also, you want to be sure that the 'instance' you pass as an argument to 
>>> the model form is the model record you want to update. For instance:
>>>
>>> def edit_story(request, story_id)
>>> story = get_object_or_404(Story, pk=story_id)
>>> if request.method == 'POST':
>>> story_form = StoryForm(request.POST, request.FILES, 
>>> instance=story)
>>> if story_form.is_valid():
>>> story_form.save()
>>> return HttpResponseRedirect("/**profiles/user_profile")
>>> else: # GET request
>>> story_form = StoryForm(instance=story)
>>> return render_to_response('report/sto**ryedit.html', {'form': 
>>> story_form}, context_instance=RequestContex**t(request))
>>>
>>>
>>>
>>> On Fri, May 18, 2012 at 4:52 PM, DF  wrote:
>>>
 Thanks. This worked:

 else:
 story_form = StoryForm(request.user, instance=story_form)


 One problem: it just adds a new version of the story instead of 
 updating the previous version. So "editing" just creates multiple versions 
 instead of actually editing the existing story.

 Is there a way to remedy this?

 On Friday, May 18, 2012 5:37:44 PM UTC-4, jondbaker wrote:
>
> The lines:
> #else:
> #story_form = StoryForm(instance=story_form)
> ...appear to be handling the GET request, and they're commented out.
>
> On Fri, May 18, 2012 at 3:22 PM, DF  wrote:
>
>> Newbie question. I have an application where registered users can 
>> submit stories. The posting and display works great but I wanted users 
>> to 
>> have the ability to edit any of their stories. The goal would be for a 
>> user 
>> to find a list of their stories on their profile page, choose one that 
>> they 
>> would like to edit, and then retrieve the form they initially submitted 
>> with the current information filled in to make the necessary edits.
>>
>> I composed a view, url and template to achieve this. The page 
>> displays, the story number from the url appears in the address bar 

Re: What all does pinax provides us once you have used a starter project ?

2012-05-19 Thread Mario Gudelj
Your question has been answered on SO.

On 20/05/2012 12:35 AM, "yugal"  wrote:

>
> I am confused as I have a starter project with Pinax and it seems its over.
>
> I have mentioned my whole scenario in
> http://stackoverflow.com/q/10569310/731963
>
> Please elaborate and share your experiences with pinax !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/lFExXc4xnEgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



bash error when trying to django_admin.py; not found -- FAQ not helping

2012-05-19 Thread Mike Manfrin
I just installed django 1.4 on my OSX.7 macbook running Python 2.7.1.

I installed first via git, and when that didn't work, I downloaded the
tar and unzipped/installed 1.4.

I am specifically getting the error:
-bash: django_admin.py: command not found

However, in /usr/local/bin, django_admin.py exists. When trying
sudo ln -s /usr/local/python2.7/site-packages/django/bin/django-
admin.py /usr/local/bin/django-admin.py
as the FAQ suggests, I get an error saying /usr/local/bin/django-
admin.py exists!

So, I am running in to two errors: One saying django_admin doesn't
exist, and the other saying it does when I try to set it up.

I'm at the point of pulling out my hair -- any help would be
appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Generic views create_object and prefill form data?

2012-05-19 Thread Paul
I have a model like this:

class Website(models.Model):
user = models.ForeignKey(User)
name = models.CharField(unique=True, max_length=32)

And use a generic view to create new items:

def website_create(request):
return create_update.create_object(
request = request,
form_class = WebsiteCreateForm)

This works except i want to prefill (and hide) the user field. Hiding
is no problem with crispy forms, but how do i prefill the user field
based on request.user?

The generic view doesn't except any initial data or pre-validate
callables.

Any help is greatly appreciated!

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Hi Jani.
I don't know why you say
" 3) Are you now trying to figure out how to plug in Django in "Adming
module/PC with GUI block"?"

My admin module and the gui do not share anything. They are not on the same
pc.
Gui is for displaying and admin for the page content management as any
Le 19 mai 2012 11:38, "Eugène Ngontang"  a écrit :

> When you're asking if my client/server already exist. You're talking about
> physical machines or applications/modules?
>
> - the machines where client module will run already exist and are used
> dayly. The client module will just be installed there and do what it has to
> do.
> - every body knows the browser/gui can be found and run anywhere.
> - Now the server machine where the web server should be running and the
> admin module will be deployed is a dedicated machine that should be set up
> specially for the project.
> - the database could be on a separated machine or anywhere, it doesn't
> matter.
>
> I don't know why you still don't understand Jani. The physical
> architecture is simple and i described it.
>
> And i was saying all will now be done in http. I just have to make my
> admin(browser) notified asynchronously, as well as my clients (i know i
> should avoid distinguish them from the gui/browser but it's for make things
> clear)
>
> See you.
> Le 19 mai 2012 08:09, "Jani Tiainen"  a écrit :
>
>> Hi,
>>
>> By looking your diagram it's still the same as you described in your
>> earlier mails. So it doesn't help at all. :)
>>
>> 1) Is your server something that exists and is used in everyday life or
>> is it something that you're going to build?
>>
>> 2) Are your clients something that already exists and is used in everyday
>> life?
>>
>> 3) Are you now trying to figure out how to plug in Django in "Adming
>> module/PC with GUI block"?
>>
>>
>> On Fri, May 18, 2012 at 6:36 AM, Eugène Ngontang wrote:
>>
>>> Hi Guys!
>>>
>>> I've been busy a bit, I'm back to thread with the high level
>>> architecture. Attached here is a diagram, just to understand what i meant.
>>>
>>> Don't pay attention for object I use to describe modules or architecture
>>> components.
>>>
>>> Now you will be able to understand what I mean by the server module, the
>>> admin module, and the client module of my architecture.
>>>
>>> As you could see on the diagram, the admin module is installd on the
>>> server(where the server module is installed) and is destined to provide
>>> views to the GUI.
>>> The clients receive and send data to the server.
>>> When the admin make some actions, some clients are notifed, and when
>>> client send informations admin (GUi is notified).
>>>
>>> Now two things come in my mind when I was thinking :
>>>
>>> - First I could stay in the way I want the server to use HTTP for the
>>> admin side, and another protocol to communicate with client. In that way
>>> the Admin Module (Django) will alter and read data from data base. and the
>>> server module will alter and read data from database. Then each information
>>> retrievement will lead in reading database since informations could have
>>> been changed. You can that's really heavy.
>>>
>>> - Second do all things in http. Mean that my server is just a web
>>> application undertanding HTTP (I will the use django for that). The server
>>> will serve request depending on the type of request, and each client will
>>> communicate with the server using HTTP.  Then server will define pages/urls
>>> for admin (to be sent to the GUI), and pages/urls  for clients.
>>> By this way, the only relation between my modules will be the protocol
>>> (HTTP for the instance) and they could be implemented in what ever language
>>> we like. The sever will run asynchronously for admin and clients.
>>>   The admin will then be just an interface to wich convert data to the
>>> right display format for the GUI. And the GUI could be any type, and for
>>> the web interface type I will use DJANGO for my Admin module.
>>>I will then also have to develop a http client for my client module.
>>>
>>> Actuallu I'm going to take the second choice, since it lets all the
>>> charge for read and write database to the server, which could run and
>>> publish informations asynchronously(websocket could help here).
>>>
>>> I precise that I'm not a web architect or designer, but i understand
>>> software architecture. I'm really a system and network engineer, with good
>>> developpement skill but not to much in web.
>>>
>>> Look now my architecture diagram and tell me if what I'm describing in
>>> the second item fit. And give idea if you have, about libraiies and or
>>> framwork that could help going fast and easy.
>>> I thing I will use django and green unicorn.
>>>
>>> Thanks for your attention.
>>>
>>>
>>>
>>> 2012/5/16 Alec Taylor 
>>>
 Oh right, it's just Pyjamas.

 Still, annoyed I didn't think to recommend it first!


 On Thu, May 17, 

Re: user.set_password('new password')

2012-05-19 Thread Min Hong Tan
thanks all :)

On Sat, May 19, 2012 at 9:49 AM, Timothy Makobu  wrote:

> user.save returns the function object, which is a valid statement, so
> Python wont raise an Exception.
>
>
> On Sat, May 19, 2012 at 9:23 AM, Min Hong Tan wrote:
>
>> hi..
>>
>> thanks!! haha... didn't notice  that. how can no error...prompt out
>> one
>>
>>
>> On Fri, May 18, 2012 at 11:48 PM, Jonathan D. Baker <
>> jonathandavidba...@gmail.com> wrote:
>>
>>> Save is a method, so it needs parentheses: user.save()
>>>
>>> Sent from my iPhone
>>>
>>> On May 18, 2012, at 10:53 PM, Min Hong Tan  wrote:
>>>
>>> Hi,
>>>
>>> I 'm trying to change password in views.py in one of my  def.
>>> having the below code.
>>> newpassword ="testing123"
>>> user = User.objects.get(username__exact = request.user)
>>> user.set_password(newpassword)
>>> user.save
>>>
>>> it didn't prompt me any error.  but, why my password still remained
>>> unchanged?
>>>
>>> Regards,
>>> MH
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Hi Jani.
I don't know why you say
" 3) Are you now trying to figure out how to plug in Django in "Adming
module/PC with GUI block"?"

My admin module and the gui do not share anything. They are not on the same
pc.
Gui is for displaying and admin for the page content management like any
web aplication works.

I please us unot to build a myster arround this thread. The problem was
simple:
I wanted my server to asynchronously manage web pages for views, and remote
dustributed clients (like in the diagram) using tcp/udp sockets.
Now all communications will be done in http and any client will use this
protocol (web browser or my app client module).
The server (a http server) will then just use an admin module based on
django.

That's the way were going to do. Now, if you have advises concerning this
impletation give them to please.
Thanks.
Le 19 mai 2012 11:38, "Eugène Ngontang"  a écrit :

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django on jb ipad

2012-05-19 Thread hone5t
greetings
i have ipad 2 and i donwload both python,sqlite3 and lightpd and wonder if 
i can run django on it or not

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/hzsQch8sI2gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django graphical query interface?

2012-05-19 Thread Lee
I'm in need of a graphical query interface for my Django app, similar
to what OpenOffice Base and MS Access provide. Ideally it would allow
the user to select a Django Admin action to perform on the returned
results, or drill into the related records. I struck out with google
and Django Packages. Anyone know of such a beast or have any
suggestions?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template: Foreign Key

2012-05-19 Thread Fady Kamal
actually it worked even without the the set.all ,thanks for help

On Sat, May 19, 2012 at 4:51 AM, Kurtis Mullins wrote:

> Whoops -- that might need to be 'house.people_set.all'. Sorry.
>
>
> On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins  > wrote:
>
>> Try something along these lines (Note: I'm switching up your variable
>> names a bit to make it easier to read)
>>
>> {% for house in houses %}
>> {{ house.name }}
>> {% for person in house.people.all %}
>> {{ person.name }}
>> {% endfor %}
>> {% endfor %}
>>
>> I just wrote that code block pretty quickly but it should step you in the
>> right direction. Also, here's a related stackoverflow post:
>> http://stackoverflow.com/questions/1014591/traversing-foreign-key-related-tables-in-django-templates
>>
>> Good lucK!
>>
>>
>> On Fri, May 18, 2012 at 7:50 PM, Fady Kamal wrote:
>>
>>> it's not working with me
>>>
>>> On Tuesday, June 30, 2009 10:43:15 AM UTC+2, russelson wrote:

 Hi,

 I'm new to django

 I have two models

 #models.py

 class House(models.Model):
 name = models.CharField(blank=True, max_length=50)

 class People(models.Model):
 name = models.CharField(blank=True, max_length=50)
 house = models.ForegnKey(House)

 #views.py
 def house_list(request):
 houses = House.objects.all()
 return render_to_response('test/**house_list.html',
 {'object_list':
 houses})

 #house_list.html
 {% for object in object_list %}
 {{ object.name }}
 {{ object.people.name }}   #!?!?
 {% endfor %}

 How do i retrieve the information in the People model?

 Please advice

 Thanks in advance

>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/piLnSG9ycFEJ.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: user.set_password('new password')

2012-05-19 Thread Timothy Makobu
user.save returns the function object, which is a valid statement, so
Python wont raise an Exception.

On Sat, May 19, 2012 at 9:23 AM, Min Hong Tan  wrote:

> hi..
>
> thanks!! haha... didn't notice  that. how can no error...prompt out one
>
>
> On Fri, May 18, 2012 at 11:48 PM, Jonathan D. Baker <
> jonathandavidba...@gmail.com> wrote:
>
>> Save is a method, so it needs parentheses: user.save()
>>
>> Sent from my iPhone
>>
>> On May 18, 2012, at 10:53 PM, Min Hong Tan  wrote:
>>
>> Hi,
>>
>> I 'm trying to change password in views.py in one of my  def.
>> having the below code.
>> newpassword ="testing123"
>> user = User.objects.get(username__exact = request.user)
>> user.set_password(newpassword)
>> user.save
>>
>> it didn't prompt me any error.  but, why my password still remained
>> unchanged?
>>
>> Regards,
>> MH
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



DB joining 3 tables in django admin, while searching on the primary table

2012-05-19 Thread Aditya Sriram M
Hi,

again, my models are Customer, Users and Devices.

I would like to search by Customer and retrieve all 'select_related' rows 
of all the three models.
Eg. like this..

Customer1 User1 Device1
Customer1 User1 Device2
Customer1 User2 Device1
Customer1 User2 Device2
etc etc..

Is this possible in Django? If so how?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/9fxgbkSr2pcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can't submit picture through generic view form

2012-05-19 Thread Michael Ackerman
I have a generic view:

class create_ticket(CreateView):
model = ticket
form_class = ticket_form
template_name = "create_ticket.html"
success_url = "/tickets/thanks/"

and a form:

class ticket_form(ModelForm):
class Meta:
model = ticket
fields = ('title','description','picture')

But when I try to submit the data, it get a "This field is required" for
the picture, so I think I'm missing something in order to take in the
picture.

and for reference:

#create_ticket.html:
{% extends "base.html" %}
{% block main %}
{% csrf_token %}
{{ form.as_table}}


{% endblock %}

#models.py
class ticket(models.Model):
title = models.CharField(max_length = 100)
date_created = models.DateTimeField(auto_now_add=True)
description = models.TextField()
ranking = models.PositiveIntegerField(default=0)
picture = models.ImageField(
upload_to ='pictures' )

def __unicode__(self):
return self.title

All help is appreciated, thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: JQuery .get new url is not updating the page

2012-05-19 Thread Lee Hinde

On May 18, 2012, at 8:24 PM, Furqan Malik wrote:

> Thanks for the reply,
> 
> You misunderstood my question.
> 
> Passed_TestCases = data['Data1']; 
> Failed_TestCases = data['Data2'];
> These values are fine, I am using them to create the table.
> 
> My question is once these values come from view.py, I want to change the 
> browser url so that url can be send to others.
> 

You're right, I did.

http://stackoverflow.com/questions/136458/change-the-url-in-the-browser-without-loading-the-new-page-using-javascript


>  
> On Fri, May 18, 2012 at 3:52 PM, Lee Hinde  wrote:
> 
> On May 18, 2012, at 11:52 AM, furqanmlk wrote:
> 
>> Hi there,
>> 
>> I implemented the JQuery to get the data from Database server and display in 
>> the form of table on the page when user click one of the DOM element.
>> I tried ,
>> 
>> JQuery Code:
>> $.get("RunId_TestCases",{Variable:Value},function(data){
>> 
>> 
>> Passed_TestCases = data['Data1'];
>> Failed_TestCases = data['Data2'];
>> //window.location.hash = this.url
>>//window.location.assign(this.url)
> 
> 
> not knowing anything about the page, but you want something more like:
> 
> $("#ID_FOR_THE_FIELD").val(data['Data1']);
> 
>> 
>> using window.location browser url gets changed but page goes to empty page 
>> with data values.
>> 
>> 
>> Can you please help to solve this issue.
>> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How do I construct a queryset for this complex query?

2012-05-19 Thread Devin
I've got a complex query that uses a combination of Q objects and
qargs to produce the following query:

Note the T4 alias...this is central to the question.

SELECT
`t_answer`.`id`,
`t_answer`.`question_id`,
`t_answer`.`survey_id`,
`t_answer`.`content_type_id`,
`t_intanswer`.`answer_ptr_id`,
`t_intanswer`.`value`
FROM
`t_intanswer`
INNER JOIN `t_answer` ON (`t_intanswer`.`answer_ptr_id` =
`t_answer`.`id`)
INNER JOIN `t_survey` ON (`t_answer`.`survey_id` = `t_survey`.`id`)
INNER JOIN `t_answer` T4 ON (`t_survey`.`id` = T4.`survey_id`)
INNER JOIN `t_booleananswer` ON (T4.`id` =
`t_booleananswer`.`answer_ptr_id`)
INNER JOIN `t_choiceanswer` ON (T4.`id` =
`t_choiceanswer`.`answer_ptr_id`)
INNER JOIN `t_facility` ON (`t_survey`.`facility_id` =
`t_facility`.`id`)
WHERE
(
(
(`t_booleananswer`.`value` = True  AND T4.`question_id` =
1742) AND
(`t_choiceanswer`.`choice_id` = 1947  AND T4.`question_id` =
1743 )
) AND
`t_survey`.`public` = False  AND
`t_survey`.`facility_id` = 82  AND
`t_survey`.`doctor_id` = 124  AND
`t_answer`.`question_id` = 1753  AND
`t_facility`.`program_id` = 71  AND
`t_survey`.`completed` IS NOT NULL AND
`t_survey`.`flagged` = False  AND
`t_survey`.`completed` < '2012-05-20 00:00:00'  AND
`t_survey`.`completed` > '2012-05-18 00:00:00' )


I'm looking for a result that contains either a boolean or choice
answer, but I've used Django's model inheritance, and both tables are
trying to join through t_answer.

Only one t_answer row can be returned for this query, so I get back
zero results.  But I need one result.  Here is the modified query in
raw SQL that solves my problem.  I create a second FROM clause using
the alias T5, then I join choice on that.   Works great.


SELECT
`t_answer`.`id`,
`t_answer`.`question_id`,
`t_answer`.`survey_id`,
`t_answer`.`content_type_id`,
`t_intanswer`.`answer_ptr_id`,
`t_intanswer`.`value`
FROM
`t_intanswer`
INNER JOIN `t_answer` ON (`t_intanswer`.`answer_ptr_id` =
`t_answer`.`id`)
INNER JOIN `t_survey` ON (`t_answer`.`survey_id` = `t_survey`.`id`)
INNER JOIN `t_answer` T4 ON (`t_survey`.`id` = T4.`survey_id`)
INNER JOIN `t_answer` T5 ON (`t_survey`.`id` = T5.`survey_id`)
INNER JOIN `t_booleananswer` ON (T4.`id` =
`t_booleananswer`.`answer_ptr_id`)
INNER JOIN `t_choiceanswer` ON (T5.`id` =
`t_choiceanswer`.`answer_ptr_id`)
INNER JOIN `t_facility` ON (`t_survey`.`facility_id` =
`t_facility`.`id`)
WHERE
(
(
(`t_booleananswer`.`value` = True  AND T4.`question_id` =
1742) AND
(`t_choiceanswer`.`choice_id` = 1947  AND T5.`question_id` =
1743 )
) AND
`t_survey`.`public` = False  AND
`t_survey`.`facility_id` = 82  AND

Cool...so I have my solution---except that I don't know how to
construct it using the Django queryset.  I looked at "extra" (https://
docs.djangoproject.com/en/1.3/ref/models/querysets/#extra) but I'm not
clear on how to use it accomplish my second INNER JOIN T5.

Any thoughts experts?  Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to display a table (with full functionalities like sorting, num rows etc) within a cell?

2012-05-19 Thread Daniel Svonava
I don't think that this is easily doable, you would have to tweak both the 
views and templates. However, whenever I think that a nested table would be 
usable, I try to achieve the same functionality by implementing 
filters/search on the models I'd like to see nested.

In your case, just add filtering (by customer)/searching on the User model, 
and browse that directly.

Daniel

On Saturday, May 19, 2012 3:33:57 PM UTC+2, Aditya Sriram M wrote:
>
> I have an admin site with two models, Customer and Users with one-to-many 
> relationship.
>
> Now when I display the customer in admin site, I wanted to display it's 
> Users in a table format. Basic HTML formatted table works fine but its too 
> rugged and not very attractive.
> Note: I do this by manually putting the  for column headers and 
>  for each of the elements in a row. 
>
> What are the options to display the users in a good table with all 
> functionalities?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FztsDXxa8Q0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to display a table (with full functionalities like sorting, num rows etc) within a cell?

2012-05-19 Thread Aditya Sriram M
I have an admin site with two models, Customer and Users with one-to-many 
relationship.

Now when I display the customer in admin site, I wanted to display it's 
Users in a table format. Basic HTML formatted table works fine but its too 
rugged and not very attractive.
Note: I do this by manually putting the  for column headers and 
 for each of the elements in a row. 

What are the options to display the users in a good table with all 
functionalities?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/XG7sIY0hBMYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to popup a window from admin site from the admin table's cell html content?

2012-05-19 Thread Aditya Sriram M
I have a function like this..

list_display = (..,get_link_to_users, ..)

   def get_link_to_users(self, obj):
html_table = ' 
My Users ' % (obj.customer_id)
print html_table
return html_table
get_link_to_fortress_users.short_description = 'Fortress Users'
get_link_to_fortress_users.allow_tags = True

Question: user and customer are my models. In Customer model, I would like 
to put just the link. And on clicking this link, a new popup should come up 
with the related users. How to do this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iEsXdDereEYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django in mobile devices

2012-05-19 Thread Alec Taylor
I use Phonegap and Django

I created my mobile app using my exposed REST API with JSON calls in JavaScript

On Sat, May 19, 2012 at 7:08 PM, Phang Mulianto  wrote:
> Hi Mario,
>
> thanks for your response.
>
> i already know about sl4a .
>
> what i mean is, are there any known project that use django / mini django
> framework parts to build apps in mobile device, in this case android only or
> even multi device.
>
> this will be nice ... do mvc in mobile use python...   i mean ruby people
> already done it.
>
>
>
>
> On Sat, May 19, 2012 at 4:20 PM, Mario Gudelj 
> wrote:
>>
>> Have a look at http://www.linuxjournal.com/article/10940
>>
>>
>> Also http://thedjangoforum.com/board/thread/879/django-python-on-a-standalone-android/
>>
>> On 19 May 2012 00:54, Phang Mulianto  wrote:
>>>
>>> HI all,
>>>
>>> i recently see rhomobile.com , which running ruby in mobile devices, and
>>> phonegap which use javascript.
>>>
>>> do anyone aware of the equivalent python / django can be used for mobile
>>> devices..
>>>
>>> i am thinking about create app for the mobile client using web technology
>>> without go deeper in java.
>>>
>>> any comment appreciated.
>>>
>>>
>>> Thanks,
>>>
>>> Mulianto
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'Settings' object has no attribute 'ROOT_URLCONF'

2012-05-19 Thread doniyor
solved, i uninstalled both python and django and then installed them again, 
now it is working... i think it was a misunderstanding for OS as it had 
several versions of django installed several times and it got confused may 
be... anyway.. for those who will meet the problem, this advice is given.. 



Am Samstag, 19. Mai 2012 07:52:58 UTC+2 schrieb doniyor:
>
> Hi 
>
> i have this problem, i dont why, i have root_urlconf in my settings.py. i 
> cannot figure out what it wants from me.. pls help 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/aAxIsZsc08UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
When you're asking if my client/server already exist. You're talking about
physical machines or applications/modules?

- the machines where client module will run already exist and are used
dayly. The client module will just be installed there and do what it has to
do.
- every body knows the browser/gui can be found and run anywhere.
- Now the server machine where the web server should be running and the
admin module will be deployed is a dedicated machine that should be set up
specially for the project.
- the database could be on a separated machine or anywhere, it doesn't
matter.

I don't know why you still don't understand Jani. The physical architecture
is simple and i described it.

And i was saying all will now be done in http. I just have to make my
admin(browser) notified asynchronously, as well as my clients (i know i
should avoid distinguish them from the gui/browser but it's for make things
clear)

See you.
Le 19 mai 2012 08:09, "Jani Tiainen"  a écrit :

> Hi,
>
> By looking your diagram it's still the same as you described in your
> earlier mails. So it doesn't help at all. :)
>
> 1) Is your server something that exists and is used in everyday life or is
> it something that you're going to build?
>
> 2) Are your clients something that already exists and is used in everyday
> life?
>
> 3) Are you now trying to figure out how to plug in Django in "Adming
> module/PC with GUI block"?
>
>
> On Fri, May 18, 2012 at 6:36 AM, Eugène Ngontang wrote:
>
>> Hi Guys!
>>
>> I've been busy a bit, I'm back to thread with the high level
>> architecture. Attached here is a diagram, just to understand what i meant.
>>
>> Don't pay attention for object I use to describe modules or architecture
>> components.
>>
>> Now you will be able to understand what I mean by the server module, the
>> admin module, and the client module of my architecture.
>>
>> As you could see on the diagram, the admin module is installd on the
>> server(where the server module is installed) and is destined to provide
>> views to the GUI.
>> The clients receive and send data to the server.
>> When the admin make some actions, some clients are notifed, and when
>> client send informations admin (GUi is notified).
>>
>> Now two things come in my mind when I was thinking :
>>
>> - First I could stay in the way I want the server to use HTTP for the
>> admin side, and another protocol to communicate with client. In that way
>> the Admin Module (Django) will alter and read data from data base. and the
>> server module will alter and read data from database. Then each information
>> retrievement will lead in reading database since informations could have
>> been changed. You can that's really heavy.
>>
>> - Second do all things in http. Mean that my server is just a web
>> application undertanding HTTP (I will the use django for that). The server
>> will serve request depending on the type of request, and each client will
>> communicate with the server using HTTP.  Then server will define pages/urls
>> for admin (to be sent to the GUI), and pages/urls  for clients.
>> By this way, the only relation between my modules will be the protocol
>> (HTTP for the instance) and they could be implemented in what ever language
>> we like. The sever will run asynchronously for admin and clients.
>>   The admin will then be just an interface to wich convert data to the
>> right display format for the GUI. And the GUI could be any type, and for
>> the web interface type I will use DJANGO for my Admin module.
>>I will then also have to develop a http client for my client module.
>>
>> Actuallu I'm going to take the second choice, since it lets all the
>> charge for read and write database to the server, which could run and
>> publish informations asynchronously(websocket could help here).
>>
>> I precise that I'm not a web architect or designer, but i understand
>> software architecture. I'm really a system and network engineer, with good
>> developpement skill but not to much in web.
>>
>> Look now my architecture diagram and tell me if what I'm describing in
>> the second item fit. And give idea if you have, about libraiies and or
>> framwork that could help going fast and easy.
>> I thing I will use django and green unicorn.
>>
>> Thanks for your attention.
>>
>>
>>
>> 2012/5/16 Alec Taylor 
>>
>>> Oh right, it's just Pyjamas.
>>>
>>> Still, annoyed I didn't think to recommend it first!
>>>
>>>
>>> On Thu, May 17, 2012 at 12:02 AM, Alec Taylor 
>>> wrote:
>>> > On Wed, May 16, 2012 at 10:49 PM, Frank Stüss 
>>> wrote:
>>> >> or maybe you might have a look at http://pyjs.org/
>>> >> which could help you having an event aware client app in your browser.
>>> >> Served by and with django.
>>> >
>>> > I'm impressed
>>> >
>>> > (just read the exec summary from homepage)
>>> >
>>> >>
>>> >> Am Sonntag, den 13.05.2012, 17:14 +0400 schrieb Alireza 

Re: Django in mobile devices

2012-05-19 Thread Phang Mulianto
Hi Mario,

thanks for your response.

i already know about sl4a .

what i mean is, are there any known project that use django / mini django
framework parts to build apps in mobile device, in this case android only
or even multi device.

this will be nice ... do mvc in mobile use python...   i mean ruby people
already done it.



On Sat, May 19, 2012 at 4:20 PM, Mario Gudelj wrote:

> Have a look at http://www.linuxjournal.com/article/10940
>
> Also
> http://thedjangoforum.com/board/thread/879/django-python-on-a-standalone-android/
>
> On 19 May 2012 00:54, Phang Mulianto  wrote:
>
>> HI all,
>>
>> i recently see rhomobile.com , which running ruby in mobile devices, and
>> phonegap which use javascript.
>>
>> do anyone aware of the equivalent python / django can be used for mobile
>> devices..
>>
>> i am thinking about create app for the mobile client using web technology
>> without go deeper in java.
>>
>> any comment appreciated.
>>
>>
>> Thanks,
>>
>> Mulianto
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Customizing Django Admin Site

2012-05-19 Thread Aditya Sriram M
Umm.. yes to some extent...

Can I make an html frame inside a cell, and then open another admin site 
inside it!?

On Monday, 7 May 2012 20:01:15 UTC+5:30, francescortiz wrote:
>
> You can create pseudo fields in the admin
>
> class CarAdmin(admin.ModelAdmin)
> list_display = ('name','custom_field')
> def custom_field(srlf, obj):
> return mark_safe('http://www.google.com;>Link')
> custom_field.short_description = 'Link to Google'
> custom_field.allow_tags = True
>
> I am not sure if this is what you look for, and I am not sure if 
> allow_tags is needed
>
> 
> 
>
> On Monday, May 7, 2012 12:41:59 PM UTC+2, Aditya Sriram M wrote:
>>
>> Hi All,
>>
>> I could successfully try the Django framework on my Oracle DB. I never 
>> thought programming would be this easy!!!
>> Thanks for the wonderful framework.
>>
>> Now, I want to have an Admin Site with 'another such admin site in its 
>> row'. Is it possible?
>>
>> Example: Take the models Customers, Users and Devices. Customers are 
>> unique and they can have 'n' Users and/or 'm' Devices.
>> I will want to display the rows in Admin Site for the Customer Model and 
>> initially provide 'Click for Users' and 'Click for Devices' buttons in the 
>> last two rows.
>> On clicking them another admin site for limited (say 10 rows) 
>> users/devices should be opened in an inner table with its own search box. 
>>
>> Is this possible? Any workarounds will be much appreciated.. Thnx..
>>
>> Regards,
>> Aditya
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/6QHQJ9vmv8wJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django in mobile devices

2012-05-19 Thread Mario Gudelj
Have a look at http://www.linuxjournal.com/article/10940

Also
http://thedjangoforum.com/board/thread/879/django-python-on-a-standalone-android/

On 19 May 2012 00:54, Phang Mulianto  wrote:

> HI all,
>
> i recently see rhomobile.com , which running ruby in mobile devices, and
> phonegap which use javascript.
>
> do anyone aware of the equivalent python / django can be used for mobile
> devices..
>
> i am thinking about create app for the mobile client using web technology
> without go deeper in java.
>
> any comment appreciated.
>
>
> Thanks,
>
> Mulianto
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django-cms text_only_plugins problem

2012-05-19 Thread Иван Иванов
Hi all!

I know that this is not exactly the right mailing list, but …

I am trying to filter the allowed plugins in the TextPlugin with the
text_only_plugins option in my settings.py. Despite of what I'm writing
in the property, I get all available plugins allowed in the select box
in the text plugin. 

Can someone help me with the issue, please?

Here are my settings:

CMS_PLACEHOLDER_CONF = {
'index.html images' : {
'plugins' : ['CMSGalleryPlugin'],
'name' : gettext('Image Gallery'),
},
'index.html text' : {
'plugins' : ['TextPlugin'],
'text_only_plugins': ['LinkPlugin'],
'name' : gettext('Text'),
},
}

Django-cms version is 2.2.

Thank you in advance!

Ivan Ivanov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tip for Geany users or those looking for lightweight IDE

2012-05-19 Thread graeme
All it needs is a quick Google to find it, but I missed it before.
This tip on the Geany wiki on how to set it up to work with a syntax
checker is veru useful - IMO it plugs the biggest gap in Geany's
functionality:

http://wiki.geany.org/howtos/check_python_code

In fact you do not need use the shell script. If you want to use just
one syntax checker (I use pyflakes) you can just call it directly.

You can also enable syntax highlighting for Django templates:

http://www.drhevans.com/blog/posts/261-enabling-django-template-syntax-highlighting-in-geany/

All I need now is static checking for templates. I have tried some
other light IDEs recently (SPE and UliPad were both nice) but neither
is as smooth and responsive, and had various minor irritants.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: admin error, cannot edit fields or delete records, url refers to incorrect primary key

2012-05-19 Thread Malcolm MacKinnon
Problem solved. I had a double defined as my primary key in the mysql db.

On Fri, May 18, 2012 at 10:49 PM, Mac  wrote:

> I've set up a 'Reps' model in the admin. I can add records
> successfully, but if I try to change a record or field, I get a 404
> error. When I try to delete a record, I get this traceback here:
> http://dpaste.com/750121/
> My primary keys are integers, but it appears that the urls return them
> as floats. Please see the example below.
>
> The model in whl.models is as follows:
>
> class Reps(models.Model):
>prim = models.AutoField(primary_key=True, db_column='PRIM')
>custno = models.CharField(max_length=50, db_column='CUSTNO',
> blank=True) # Field name made .
>company = models.CharField(max_length=50, db_column='COMPANY',
> blank=True)# Field name made
>#etc, etc.
>
>class Meta:
>db_table = u'whl_reps'
>def __unicode__(self):
>return self.custno + " : " + str(self.company)+" :
> "+str(self.city)+" : "+str(self.state)
>def get_absolute_url(self):
>return "/%i/" % self.prim
>
> My admin.py is:
>
> from whl.models import Reps
>
> class RepAdmin(admin.ModelAdmin):
>fields = ('company', 'email',  'salesmn',  'city',  'state')
>
> And for example when I click on a record to change it, I get a 404
> error with a message "reps object with primary key u'39.0' does not
> exist". In this case, when i click on a record, it returns this url
>
> localhost/admin/whl/reps/39.0/
>
> As you can see, the last primary key above is not an integer as it
> should be. When I manually change the url to /admin/whl/reps/39/ I can
> edit the record.
>
> I'm using Django 1.4, mysql db on Ubuntu.
>
> Any thoughts on why this is happening? Any help would be appreciated
> very much. Thanks.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: user.set_password('new password')

2012-05-19 Thread Min Hong Tan
hi..

thanks!! haha... didn't notice  that. how can no error...prompt out one

On Fri, May 18, 2012 at 11:48 PM, Jonathan D. Baker <
jonathandavidba...@gmail.com> wrote:

> Save is a method, so it needs parentheses: user.save()
>
> Sent from my iPhone
>
> On May 18, 2012, at 10:53 PM, Min Hong Tan  wrote:
>
> Hi,
>
> I 'm trying to change password in views.py in one of my  def.
> having the below code.
> newpassword ="testing123"
> user = User.objects.get(username__exact = request.user)
> user.set_password(newpassword)
> user.save
>
> it didn't prompt me any error.  but, why my password still remained
> unchanged?
>
> Regards,
> MH
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use Django to implement my GUI!

2012-05-19 Thread Jani Tiainen
Hi,

By looking your diagram it's still the same as you described in your
earlier mails. So it doesn't help at all. :)

1) Is your server something that exists and is used in everyday life or is
it something that you're going to build?

2) Are your clients something that already exists and is used in everyday
life?

3) Are you now trying to figure out how to plug in Django in "Adming
module/PC with GUI block"?


On Fri, May 18, 2012 at 6:36 AM, Eugène Ngontang wrote:

> Hi Guys!
>
> I've been busy a bit, I'm back to thread with the high level architecture.
> Attached here is a diagram, just to understand what i meant.
>
> Don't pay attention for object I use to describe modules or architecture
> components.
>
> Now you will be able to understand what I mean by the server module, the
> admin module, and the client module of my architecture.
>
> As you could see on the diagram, the admin module is installd on the
> server(where the server module is installed) and is destined to provide
> views to the GUI.
> The clients receive and send data to the server.
> When the admin make some actions, some clients are notifed, and when
> client send informations admin (GUi is notified).
>
> Now two things come in my mind when I was thinking :
>
> - First I could stay in the way I want the server to use HTTP for the
> admin side, and another protocol to communicate with client. In that way
> the Admin Module (Django) will alter and read data from data base. and the
> server module will alter and read data from database. Then each information
> retrievement will lead in reading database since informations could have
> been changed. You can that's really heavy.
>
> - Second do all things in http. Mean that my server is just a web
> application undertanding HTTP (I will the use django for that). The server
> will serve request depending on the type of request, and each client will
> communicate with the server using HTTP.  Then server will define pages/urls
> for admin (to be sent to the GUI), and pages/urls  for clients.
> By this way, the only relation between my modules will be the protocol
> (HTTP for the instance) and they could be implemented in what ever language
> we like. The sever will run asynchronously for admin and clients.
>   The admin will then be just an interface to wich convert data to the
> right display format for the GUI. And the GUI could be any type, and for
> the web interface type I will use DJANGO for my Admin module.
>I will then also have to develop a http client for my client module.
>
> Actuallu I'm going to take the second choice, since it lets all the charge
> for read and write database to the server, which could run and publish
> informations asynchronously(websocket could help here).
>
> I precise that I'm not a web architect or designer, but i understand
> software architecture. I'm really a system and network engineer, with good
> developpement skill but not to much in web.
>
> Look now my architecture diagram and tell me if what I'm describing in the
> second item fit. And give idea if you have, about libraiies and or framwork
> that could help going fast and easy.
> I thing I will use django and green unicorn.
>
> Thanks for your attention.
>
>
>
> 2012/5/16 Alec Taylor 
>
>> Oh right, it's just Pyjamas.
>>
>> Still, annoyed I didn't think to recommend it first!
>>
>>
>> On Thu, May 17, 2012 at 12:02 AM, Alec Taylor 
>> wrote:
>> > On Wed, May 16, 2012 at 10:49 PM, Frank Stüss 
>> wrote:
>> >> or maybe you might have a look at http://pyjs.org/
>> >> which could help you having an event aware client app in your browser.
>> >> Served by and with django.
>> >
>> > I'm impressed
>> >
>> > (just read the exec summary from homepage)
>> >
>> >>
>> >> Am Sonntag, den 13.05.2012, 17:14 +0400 schrieb Alireza Savand:
>> >>> No, i posted django-tastypie not tastypie itself and it's easy to use.
>> >>> Anyway if i'm implementing GUI based i would make it website, since
>> >>> it's an advantages of SaaS.
>> >>> But using client app[desktop-app] and a server-app[django] and having
>> >>> multiply client and ... makes maintaining like a nightmare.
>> >>> All i knew was that, Despite that you asked several question and i
>> >>> just claimed to help in one of them :D
>> >>>
>> >>> On Sun, May 13, 2012 at 4:06 PM, Eugène Ngontang > >
>> >>> wrote:
>> >>> Yes, I can see tastypie is a good service, that even support
>> >>> REST protocol.
>> >>>
>> >>> But I'd firt basically implement my gui with django and when i
>> >>> will master well django, i could use tastypie, and turn my
>> >>> server to support REST, it will be a good thing.
>> >>>
>> >>> But please let's keep using only django for the begining.
>> >>>
>> >>> Thanks.
>> >>>
>> >>>
>> >>> 2012/5/13 Alireza Savand 
>> >>>