Global filtering of the querystes

2013-01-21 Thread Jani Tiainen
Hi, I've several models that share same attribute and form doing ajax queries to/from form in a browser window. For example owner: class MyClass(models.Model): title = models.TextField(max_length=100) owner = models.TextField(max_length=100) class MyOtherClass(models.Model):

Re: How can I find and clean an user's session from an user's id?

2013-01-21 Thread Jamie Lawrence
It is ok. Really. In llvikgiimn. In. Go g -j I hurry. -- Sent from a phone, please excuse typos and terseness. On Jan 21, 2013, at 4:10 PM, Nikolas Stevenson-Molnar wrote: > I took a quick peek at the sessions implementation and it doesn't look > like this is

Re: no attribute JSONEncoder

2013-01-21 Thread Nikolas Stevenson-Molnar
Does this happen only in production running via mod_wsgi, or does it happen in local development with the Django dev server as well? _Nik On 1/21/2013 4:13 PM, ghjim wrote: > Hello, > > I am getting an error when I access my root WSGIScriptAlias /: > > AttributeError at / > module object has no

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-21 Thread Nikolas Stevenson-Molnar
Hi Matt, Firstly, I encourage you to have another crack a the ORM. It can certainly seem a bit aggravating at times if you're coming from a SQL mindset, but really pays off down the road in terms of maintainability and readability. Typically you should only need raw queries in Django in cases

download pdf in admin

2013-01-21 Thread grat
hi, i cannot download file upladed by admin. i have this model: class Smlouvy(models.Model): note= models.TextField(blank=True) pdf= models.FileField( upload_to = 'scany/%Y/%m/%d',blank=True,verbose_name="Pdf Filw") in Admin i upladed file, and file is in correct directory.

no attribute JSONEncoder

2013-01-21 Thread ghjim
Hello, I am getting an error when I access my root WSGIScriptAlias /: AttributeError at / module object has no attribute JSONEncoder. I have seen similar reports on the web, some of them implying that this is a python bug but I can't implement any of the fixes. I am using Django 1.4.3 and

Re: How can I find and clean an user's session from an user's id?

2013-01-21 Thread Toni
Hi, Maybe this helps you: http://stackoverflow.com/a/4892370/938046 2013/1/21 Serge G. Spaolonzi > I am looking the way to selective clear determinate user sessions from the > server. It has to be done from outside the user's session or request. > The complete user case

Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-21 Thread Matt Andrews
Hi all, Fairly new to Django. I ended up pulling out all of the ORM-generated queries and writing my own SQL directly (I got fed up trying to work out how to achieve the kind of things I needed without Django adding in extra joins or unintended WHERE clauses etc). All my app's SQL uses

Re: Database Transaction

2013-01-21 Thread Jian Chang
you mean two different databases? you can't do the transaction between two different databases. Anyway you can control the transactions by yourself. like: commit all or rollback all if all actions are ok or not, 2013/1/21 Sandeep kaur > Hello Django users, > I have

get_absolute_url goes to ../../../r/14/1/

2013-01-21 Thread Chad Vernon
I'm implementing the get_absolute_url method on one of my models. @models.permalink def get_absolute_url(self): return ('viewProject', (), {'projectSlug' : self.slug}) My url has: url(r'^(?P[-\w]+)/$', 'assetlibrary.views.viewProject', name='viewProject'), However, in the

Re: How can I find and clean an user's session from an user's id?

2013-01-21 Thread Serge G. Spaolonzi
Thanks. On Mon, Jan 21, 2013 at 10:10 PM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > I took a quick peek at the sessions implementation and it doesn't look > like this is possible just using the sessions framework (since it only > stores Session -> User and not User -> Session).

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread Nikolas Stevenson-Molnar
Upon a second glance, it looks like the clearsession command will only have an effect as of Django 1.5. For <=1.4 if you're using the DB backend, you could always clear them out yourself with a query: now = datetime.datetime.now() Session.objects.filter(expire_date__lt=now).delete() _Nik On

Re: How can I find and clean an user's session from an user's id?

2013-01-21 Thread Nikolas Stevenson-Molnar
I took a quick peek at the sessions implementation and it doesn't look like this is possible just using the sessions framework (since it only stores Session -> User and not User -> Session). You could subclass one of the existing session backends and store this information yourself (look at

How can I find and clean an user's session from an user's id?

2013-01-21 Thread Serge G. Spaolonzi
I am looking the way to selective clear determinate user sessions from the server. It has to be done from outside the user's session or request. The complete user case is: 1) Django process receives a ping with the id of the user to clear the session 2) Django process searchs the session for that

Re: Calculate availability based on Events

2013-01-21 Thread Mario Gudelj
I'm not sure I fully understand your requirement, but I did something similar recently where I need to calculate the first available time slot for a service for a given staff and create an appointment for that time slot if the customer wants it. The staff model in this case has the availability

Re: ignore field during form validation

2013-01-21 Thread Mario Gudelj
Add required=False to the form field and it won't be validated. On 22 Jan, 2013 2:30 AM, "Jonathan D. Baker" wrote: > Hi Sarfraz, > > If your form class inherits from ModelForm, you can use a subset of fields > within your form per the following documentation: >

Re: Looking for a session cart

2013-01-21 Thread Mario Gudelj
Use django-cart. It does store the cart content in db but it stores the session as well, so it will nicely match the user to their cart content according to the cart id stored inside a cookie. It's a breeze to implement with any product model. I highly recommend it. On 22 Jan, 2013 7:43 AM,

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread Nikolas Stevenson-Molnar
Hi Spork, See this section of the sessions docs: https://docs.djangoproject.com/en/1.4/topics/http/sessions/#clearing-the-session-table While it mentions file and db backends specifically, I assume the cache backend would work similarly. I.e., you need to periodically run a cleanup of session

Re: Looking for a session cart

2013-01-21 Thread frocco
Thanks, I need to look at this, not sure how django-cart knows what records are for each user logged in. On Monday, January 21, 2013 11:12:01 AM UTC-5, Stefano Probst wrote: > > > But this is what > "sessions"does. > By default a

Re: looking for an app to view various github repositories within a django powered site

2013-01-21 Thread Pankaj Singh
Hi, I could not any recent work similar to what you have described. Charles Leifer tried to do some django+github[1] integration and his work is available on github[2]. There are good implementations of Github Oauth as you can see it in django-social-auth[3] and django-allauth[4]. There are

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread testbackupacct
Nik, My concerns are about security. I have some sensitive data associated with each user's session, and I'd like to make sure it is deleted when the user logs out or their session times out or closes their browser window. There's also some other clean up actions I'd like to do under the same

looking for an app to view various github repositories within a django powered site

2013-01-21 Thread garagefan
I'm looking to build a website to collaborate on some open source projects. I'd like to set up discussions based on git repositories, and maybe even allow folks to contribute/fork/submit issues, etc. I could handle this on my own, but its more of a side fun project for myself and I'd rather

Calculate availability based on Events

2013-01-21 Thread Tijmen
Hi, I would like to calculate the availability of a service which holds zero or more events. The model looks like this: class Service(models.Model): name = models.CharField(max_length=75) class Event(models.Model): event_class = models.CharField(max_length=75) service =

Re: Looking for a session cart

2013-01-21 Thread Stefano Probst
But this is what "sessions"does. By default a session is saved in the database but you can move it also in a cache (https://docs.djangoproject.com/en/1.4/topics/http/sessions/#using-cached-sessions ). Memcached is realy

Cascading deletes in Admin: ForeignKey with on_delete=models.DO_NOTHING from an unmanaged table fails when the table does not exist

2013-01-21 Thread Dorenthas
I ran into an issue today with the Django Admin and I was wondering if this was "by design" (in which case I'd like to understand what the rationale is) or if it was an actual bug that deserves a ticket. Here's sample code to illustrate the problem. # models.py class

Re: ignore field during form validation

2013-01-21 Thread Jonathan D. Baker
Hi Sarfraz, If your form class inherits from ModelForm, you can use a subset of fields within your form per the following documentation: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form If you're not inheriting from ModelForm, then it's a matter

Re: Looking for a session cart

2013-01-21 Thread frocco
I found django-cart, but it seems to write to the database. I want to keep items in session until they checkout. Thanks for the link to Shop, I will take a look at that also. On Monday, January 21, 2013 8:54:00 AM UTC-5, Stefano Probst wrote: > > Did you mean something like >

Re: Looking for a session cart

2013-01-21 Thread Stefano Probst
There is also a finished Shop application if you want looking how other solve this Problem. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Looking for a session cart

2013-01-21 Thread Stefano Probst
Did you mean something like "sessions"( example )? Am Montag, 21. Januar 2013 13:50:13 UTC+1 schrieb frocco: > > Hello, > > I am learning django and want to port an

RE: want to update only a few fields of a form

2013-01-21 Thread Babatunde Akinyanmi
Hi, this is well documented in the online documentation https://docs.djangoproject.com/en/dev/topics/forms/?from=olddocs https://docs.djangoproject.com/en/dev/ref/forms/validation/ If you define the fields you want to with required=False, you shouldn't have issues Sent from my Windows Phone

Database Transaction

2013-01-21 Thread Sandeep kaur
Hello Django users, I have created a django application whose database is totally different(different foreign keys, fields, tables etc.) from that of old application. But now when I have created the application I require the data from old application too. How can I do the data transaction among

want to update only a few fields of a form

2013-01-21 Thread Sarfraz ahmad
i want to update only a few fields of a form bt not with the cleaned method i need to validate them in a view... please tell me a solution thenk you all -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web

Re: ignore field during form validation

2013-01-21 Thread Sarfraz ahmad
Hello everyone, i m facing a problem while validating django form. i have 5 form fields in a form and in the view i want to validate only three form fields which i need to update .. tell me a solution if anyone have any -- You received this message

Looking for a session cart

2013-01-21 Thread frocco
Hello, I am learning django and want to port an app over from PHP. In PHP, I use a session cart to store items purchased. Is there anything for django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit