HELP with Templates

2009-07-31 Thread Venkat Rao
Hello, I am developing a personal website with django on google app engine. The site works when I do not use templates. See here: vrao423.appspot.com. But when I change try to use templates I separate the base into files index and base. Here is my base: http://www.w3.org/ TR/html4/strict.dtd">

howto change FileField value in model.save() ?

2009-07-31 Thread Shuge Lee
Take a look here http://dpaste.com/73953/ or following # in models.py class Seed(models.Model): name = models.CharField(max_length=128) UPLOAD_ROOT = 'uploads' files = models.FileField(upload_to=UPLOAD_ROOT, blank=True, null=True) source = models.CharField(max_length=256,

Re: Stopping people loging in twice

2009-07-31 Thread Malcolm Tredinnick
On Fri, 2009-07-31 at 20:56 -0700, django user wrote: > So is there a viable django solution for this problem? You can implement your own session support. It's not that difficult. Django is just a layer on top of Python, so there's a Django solution to any computable problem. Django's default

Re: Stopping people loging in twice

2009-07-31 Thread django user
So is there a viable django solution for this problem? On Jul 31, 7:50 pm, Malcolm Tredinnick wrote: > On Fri, 2009-07-31 at 19:43 -0700, django user wrote: > > I'm interested in a solution for this as well. > > > I am thinking that a good way might be to rewrite the

Re: How to Allow "-" character in usernames in the admin application

2009-07-31 Thread Vasil Vangelovski
You can unregister the User model and default UserAdmin from the admin site, then register it again but after changing form and add_form of UserAdmin with you custom form classes. Looking at the code for django.contrib.auth.admin will probably make things clearer for you:

Re: permalink don't works

2009-07-31 Thread Brian May
On Thu, Jul 30, 2009 at 12:18:17AM -0700, gentlestone wrote: > I found this text on the tutorial page > http://docs.djangoproject.com/en/dev/ref/models/instances/ > - > ...you could reference this using permalink() as follows: > >

Re: Stopping people loging in twice

2009-07-31 Thread Malcolm Tredinnick
On Fri, 2009-07-31 at 19:43 -0700, django user wrote: > I'm interested in a solution for this as well. > > I am thinking that a good way might be to rewrite the auth middleware > to check and see if a user login for this user exists and if it does > then remove that login and log in the current

Re: Stopping people loging in twice

2009-07-31 Thread django user
I'm interested in a solution for this as well. I am thinking that a good way might be to rewrite the auth middleware to check and see if a user login for this user exists and if it does then remove that login and log in the current user. A message could then be passed to the login page letting

Re: Log in problem

2009-07-31 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Try: {% if user.is_authenticated() %} If that doesn't work, you would need to setup the TEMPLATE_CONTEXT_PROCESSORS setting in settings.py. http://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors Luke

Re: Dynamic Choices for ChoiceField

2009-07-31 Thread Malcolm Tredinnick
On Fri, 2009-07-31 at 16:31 -0700, mviamari wrote: > Hello, > > I'm trying to make a form for data entry into my database that uses > ChoiceFields for foreign keys. Obviously, the ideal choice would be > ModelChoiceField, however I'm not using the django ORM, so I've > assumed that's not going

Re: how to get some related data from different tables to one queryset?

2009-07-31 Thread Malcolm Tredinnick
On Fri, 2009-07-31 at 14:42 -0700, Unnamed_Hero wrote: > I have something like this: > > class Translation1(models.Model): > code = models.IntegerField(primary_key=True) > description = models.CharField() > > class Translation2(models.Model): > code =

Re: using the stable api

2009-07-31 Thread Malcolm Tredinnick
On Fri, 2009-07-31 at 11:42 -0400, Faheem Mitha wrote: > > Hi everybody, > > I upgraded from somewhere around Django 1.0 to 1.0.2, and some things > broke and had to be changed. In the following, f is an object of class > 'django.core.files.uploadedfile.TemporaryUploadedFile'. I need to > >

Re: Stopping people loging in twice

2009-07-31 Thread Brian May
On Fri, Jul 31, 2009 at 08:04:50AM -0700, When ideas fail wrote: > Is there a way i can stopped people who are already logged in logging > in again? My initial thought - this sounds risky - for a website. How do you know if the user is already logged in? The computer they were using may have

Re: Log in problem

2009-07-31 Thread When ideas fail
Ok, thanks, i will try that. As a thought could i not have something like: {% ifequal user.username "" %} login form {% else %} you are already logged in I don't know if that would work or not though. On 1 Aug, 01:30, Luke Seelenbinder wrote: > -BEGIN PGP

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
Thanks :) Luke Seelenbinder wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > No, you would not. Hope that helps. > > Luke > > luke.seelenbin...@gmail.com > > "I [may] disapprove of what you say, but I will defend to the death your > right to say it." -- Voltaire > > > Vasil

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 No, you would not. Hope that helps. Luke luke.seelenbin...@gmail.com "I [may] disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire Vasil Vangelovski wrote: > It's like this: > I actually have 3 projects.

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
It's like this: I actually have 3 projects. These projects share apps. So all the apps besides the third party ones are placed in one folder which is on PYTHONPATH. The third party ones are in another folder on the PYTHONPATH. Yes 2 of these projects use the admin and do use the ModelBackend

Re: Log in problem

2009-07-31 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 No it doesn't. That would be your problem, you would have to write a custom backend if you wanted to not show the login form to already logged-in visitors. Luke luke.seelenbin...@gmail.com "I [may] disapprove of what you say, but I will defend to

Re: Log in problem

2009-07-31 Thread When ideas fail
I'm using (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'blogSite/login.html'}), for the view, so does that pass a request of not? On 1 Aug, 01:09, Luke Seelenbinder wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Are you passing

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vasil, That will vary on what the apps you are using. If none of the apps depend on django.contrib.auth, you won't need it, unless you want to use the django admin (which depends on django.contrib.auth). To fully answer your question, we would need

Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
I'm making a very small project that will use the apps/models from a larger one. This will be hosted on a separate domain. Now the larger project uses the models from django.contrib.auth, but I don't need and don't want to store users in a database for this smaller one. I'll just provide my

Re: Log in problem

2009-07-31 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you passing the "request" to it? That's the only thing I can think of that would mess it up, otherwise it looks good syntactically. Luke luke.seelenbin...@gmail.com "I [may] disapprove of what you say, but I will defend to the death your right

Log in problem

2009-07-31 Thread When ideas fail
Hi, i am using this template to log people in, but it seems to always return the login form no matter what i do, i can be logged in or logged out and it will still say i need to log in. Does anyone know what might be happening. Any help would be appreciated. Thanks {% extends

Dynamic Choices for ChoiceField

2009-07-31 Thread mviamari
Hello, I'm trying to make a form for data entry into my database that uses ChoiceFields for foreign keys. Obviously, the ideal choice would be ModelChoiceField, however I'm not using the django ORM, so I've assumed that's not going to work (I'm using Elixir/SQLAlchemy). I originally set the

how to get some related data from different tables to one queryset?

2009-07-31 Thread Unnamed_Hero
I have something like this: class Translation1(models.Model): code = models.IntegerField(primary_key=True) description = models.CharField() class Translation2(models.Model): code = models.IntegerField(primary_key=True) description = models.CharField() class

Re: Multi select field with images

2009-07-31 Thread django user
shameless bump. Still can't figure out how this would be accomplished... On Jul 8, 8:01 pm, Tim Boy wrote: > What's the best way to make this "custom" widget. I can't find any > information online with someone making a widget do anything different to the > actual html of

How to Allow "-" character in usernames in the admin application

2009-07-31 Thread tristan
In our webapp we needed to allow dashes "-" in our usernames. I've enabled that for the consumer signup process just fine with this regex r'^[\w-]+$' How can I tell the admin app so that I can edit usernames in auth > users to allows the "-" character in usernames?

Re: forward declaration

2009-07-31 Thread Daymien
I got it! 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

Re: quick question: how to have *.domainname.com url in django

2009-07-31 Thread Javier Guerra
On Fri, Jul 31, 2009 at 1:23 PM, weiwei wrote: > Could you please expand  the process " send all those names to the > same Django instance" a little bit more detailed? that's totally about the frontend server and not about Django. As Graham said, apache accepts

Re: forward declaration

2009-07-31 Thread Alex Gaynor
On Fri, Jul 31, 2009 at 1:56 PM, Daymien wrote: > > Hallo, > > How could I implement forward declaration in django models? > this example wouldn't work for me: > Has anyone an idear or a solution? > > This django model show a simple implementation for a bloodline

forward declaration

2009-07-31 Thread Daymien
Hallo, How could I implement forward declaration in django models? this example wouldn't work for me: Has anyone an idear or a solution? This django model show a simple implementation for a bloodline app! from

Re: odd behavior with session variable that contains a list

2009-07-31 Thread Margie
Makes perfect sense, thanks for that pointer! On Jul 31, 11:17 am, Alex Gaynor wrote: > On Fri, Jul 31, 2009 at 1:15 PM, Margie wrote: > > > I am seeing some behavior with session that I don't understand.  If I > > have a session variable called

Re: quick question: how to have *.domainname.com url in django

2009-07-31 Thread weiwei
Could you please expand the process " send all those names to the same Django instance" a little bit more detailed? Thanks On Jul 31, 7:17 am, Javier Guerra wrote: > On Fri, Jul 31, 2009 at 12:26 AM, weiwei wrote: > > thanks, i was thinking

Re: odd behavior with session variable that contains a list

2009-07-31 Thread Alex Gaynor
On Fri, Jul 31, 2009 at 1:15 PM, Margie wrote: > > I am seeing some behavior with session that I don't understand.  If I > have a session variable called recentAddIds that contains a list.  I > find that if I append to that list, like this: > >  

odd behavior with session variable that contains a list

2009-07-31 Thread Margie
I am seeing some behavior with session that I don't understand. If I have a session variable called recentAddIds that contains a list. I find that if I append to that list, like this: request.session['recentAddIds'].append(newlySavedId) Then when I next receive a GET, I find that

Re: Template links when Django not domain root

2009-07-31 Thread Adam Yee
On Jul 30, 7:29 pm, Graham Dumpleton wrote: > If you are using mod_wsgi then you definitely do not need > FORCE_SCRIPT_NAME as mod_wsgi does the correct think in respect of > setting up SCRIPT_NAME/PATH_INFO. The only time it might not be right > with mod_wsgi is if

One to many relationship question

2009-07-31 Thread supercodepoet
I come from the world of Java and Hibernate and trying to get familiar with Django (loving it by the way). The issue I am running into is the relationship setup between the model classes and there related objects. For instance say i have: class Blog(models.Model): name = models.CharField()

Re: Error with runserver using jython

2009-07-31 Thread Brandon
If I trash the .class files created by startproject, I can successfully run the built-in server after the classes are re- compiled. On Jul 31, 11:21 am, fwierzbicki wrote: > On Jul 31, 9:46 am, Brandon Taylor wrote:> Hi > everyone, > > > I

Re: Error with runserver using jython

2009-07-31 Thread fwierzbicki
On Jul 31, 9:46 am, Brandon Taylor wrote: > Hi everyone, > > I created a new project through jython/django-admin.py and now I'm > receiving this error when attempting to start the development server > using jython... This is a known bug on Jython, but we haven't gotten

Re: Stopping people loging in twice

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 17:04 , When ideas fail wrote: > > Hello, if i am using this generic view in my urls.py? > > (r'^accounts/login/$', 'django.contrib.auth.views.login', > {'template_name': 'myapp/login.html'}), > > Is there a way i can stopped people who are already logged in logging > in again?

creating a list of sql that is executed

2009-07-31 Thread delfick755
Hello, I have a situation where I've created a site using django, using sqlite3. Thus far I've always had the database under version control (which, seeing as it's a binary file, doesn't mean much other than the fact I have a backup) The problem becomes when I make changes on my home computer

Re: Stopping people loging in twice

2009-07-31 Thread Gaddoz
I would like to do something like this, too! Please help! On Fri, Jul 31, 2009 at 5:04 PM, When ideas fail wrote: > > Hello, if i am using this generic view in my urls.py? > > (r'^accounts/login/$', 'django.contrib.auth.views.login', > {'template_name':

Re: Threaded application + IntegrityError

2009-07-31 Thread ramya
http://stackoverflow.com/questions/1212864/threaded-application-integrityerror On Jul 31, 9:41 am, ramya wrote: > Hi, > I have python threaded application + Postgres. I am using Django's ORM > to save to Postgres.. > I have concurrent save calls. Occasionally 2 threads

using the stable api

2009-07-31 Thread Faheem Mitha
Hi everybody, I upgraded from somewhere around Django 1.0 to 1.0.2, and some things broke and had to be changed. In the following, f is an object of class 'django.core.files.uploadedfile.TemporaryUploadedFile'. I need to 1) Get the contents of the file corresponding to f. I had to change

Re: Threaded application + IntegrityError

2009-07-31 Thread Joshua Russo
On Fri, Jul 31, 2009 at 12:41 PM, ramya wrote: > > Hi, > I have python threaded application + Postgres. I am using Django's ORM > to save to Postgres.. > I have concurrent save calls. Occasionally 2 threads save with the > same primary key which leads to an issue. > >

Stopping people loging in twice

2009-07-31 Thread When ideas fail
Hello, if i am using this generic view in my urls.py? (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}), Is there a way i can stopped people who are already logged in logging in again? Thanks --~--~-~--~~~---~--~~

[solved] processing html arrays

2009-07-31 Thread Salvatore Leone
Salvatore Leone ha scritto: > Hi, > > I've a form with a html array. How can I process this array in my view > after the submit? > > I'm pretty sure the html code is correct because I can manage the array > with a php script... so there must be a way to do it in python. > > -Salvatore >

Re: Thoughts on many-to-many relationship

2009-07-31 Thread Wyley
Hi Prabhu, You are correct about how to fix the error you're seeing, but I think you're confused about why you're seeing it. As with all relationships, an object in a many-to-many relationship must have a primary key value before you can point a foreign key value at it from another table. When

Re: "join" query in Django?

2009-07-31 Thread Javier Guerra
On Fri, Jul 31, 2009 at 1:42 AM, Asinox wrote: > i try > with .filter("field1__field2") where the field1 is the PK and the > field2 is the FK. that dowsn't sound right. i think you've misread the ORM chapters of the documentation. don't try to think in terms of the SQL you

Re: quick question: how to have *.domainname.com url in django

2009-07-31 Thread Javier Guerra
On Fri, Jul 31, 2009 at 12:26 AM, weiwei wrote: > thanks, i was thinking to have each user have a url as > http://username.domain.com/ after you manage to configure your frontend server (apache, lightttpd, nginx, whatever) to send all those names to the same

redirecting after login

2009-07-31 Thread When ideas fail
I was wondering if there was a way to redirect users after login to the page they where looking at before they logged in. So if they where on "/blog/" when they logged in they could be redirected back and if they where on "/about_us/" they could be redirected to "/about_us/"? I'd appreciate any

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Mirat Bayrak
i read it but i want to try my method, can anybody has idea how can i implement it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re:

2009-07-31 Thread Margie
Hi Vasil. Thanks for the snippets, those are useful. I was somehow just very confused on the mechanism that was being described, but it all makes sense now. Margie On Jul 30, 11:41 am, Margie wrote: > Hi Vasil, > > Could you clarify how I access the variable from

Re: How can I reload attributes from the database

2009-07-31 Thread Karen Tracey
On Fri, Jul 31, 2009 at 8:53 AM, Fleg wrote: > > Yes, I saw this case and that's what I need... > The point is that the proposed fix implies to patch the django core > which I would prefer to avoid. > The other solution need to add as many lines of code as you have >

Error with runserver using jython

2009-07-31 Thread Brandon Taylor
Hi everyone, I created a new project through jython/django-admin.py and now I'm receiving this error when attempting to start the development server using jython... iMac:musaic bt$ jython manage.py runserver Traceback (most recent call last): File "manage.py", line 4, in import settings

Threaded application + IntegrityError

2009-07-31 Thread ramya
Hi, I have python threaded application + Postgres. I am using Django's ORM to save to Postgres.. I have concurrent save calls. Occasionally 2 threads save with the same primary key which leads to an issue. Postgres log: ERROR: duplicate key value violates unique constraint "store_pkey"

processing html arrays

2009-07-31 Thread Salvatore Leone
Hi, I've a form with a html array. How can I process this array in my view after the submit? I'm pretty sure the html code is correct because I can manage the array with a php script... so there must be a way to do it in python. -Salvatore

Re: clean_() doesn't handle images?

2009-07-31 Thread Martje
Excellent! Thank you! On 31 jul, 14:42, Karen Tracey wrote: > On Fri, Jul 31, 2009 at 3:18 AM, Martje wrote: > > > I don't understand, sorry :$. Do you care to explain a little bit > > more? Or could you give an example? > > > I'm using the admin

Re: Setting up django on xampp with apache, python 2.6 and mod_wsgi

2009-07-31 Thread Michael Ralan
Karen hi, Thanks for the reply. I think I narrowed it down to the way I installed Python on this server. I can run django applications and other python scripts just fine from the command line. It turns out that a quick way to test my Python + Apache setup is replace the .wsgi file with the

Re: Setting up django on xampp with apache, python 2.6 and mod_wsgi

2009-07-31 Thread Karen Tracey
On Fri, Jul 31, 2009 at 8:53 AM, Michael Ralan wrote: > > > I get an (unhelpful) xampp error message that reads > > > Microsoft Visual C++ Runtime Library > --- > Runtime Error! > > Program: C:\xampp\apache\bin\httpd.exe > > R6034 > > An application has

Re: Django on Jython

2009-07-31 Thread Brandon
Nevermind. I chose the "standard" option when installing Jython, which doesn't include sources. If you choose the "all" option, distutils is included. Hope that helps someone, Brandon On Jul 31, 7:48 am, Brandon Taylor wrote: > Hello everyone, > > I'm getting a Jython

Re: How can I reload attributes from the database

2009-07-31 Thread Fleg
Yes, I saw this case and that's what I need... The point is that the proposed fix implies to patch the django core which I would prefer to avoid. The other solution need to add as many lines of code as you have associated objects (and for all objects)... which is quite heavy (if you add a foreign

Re: Setting up django on xampp with apache, python 2.6 and mod_wsgi

2009-07-31 Thread Michael Ralan
I get an (unhelpful) xampp error message that reads Microsoft Visual C++ Runtime Library --- Runtime Error! Program: C:\xampp\apache\bin\httpd.exe R6034 An application has made an attempt to load the C runtime library incorrectly. Please contact the application's

Django on Jython

2009-07-31 Thread Brandon Taylor
Hello everyone, I'm getting a Jython environment set up, and have it installed and working properly. Now it's time to install django-jython and django itself. The problem is, I can't install django-jython because I don't have distutils installed for Jython. I also can't seem to find distutils

Re: Setting up django on xampp with apache, python 2.6 and mod_wsgi

2009-07-31 Thread Karen Tracey
On Fri, Jul 31, 2009 at 8:36 AM, Michael Ralan wrote: > > Hi, > > I've searched the internet and come across a couple of pages > ostensibly showing how this is done, but even the django documentation > itself (sans being xampp-specific) has not met me with success. > > I got to

Re: dynamic form

2009-07-31 Thread derek
On Jul 31, 10:31 am, Salvatore Leone wrote: > Hi, > > I've got a form with various information and a file upload widget. > > Is there a way to uploads many files at the same time? So to have a link > "add file" (and even "remove" file for already selected files). >

Setting up django on xampp with apache, python 2.6 and mod_wsgi

2009-07-31 Thread Michael Ralan
Hi, I've searched the internet and come across a couple of pages ostensibly showing how this is done, but even the django documentation itself (sans being xampp-specific) has not met me with success. I got to the point where I've installed mod_wsgi, set up the test app but am struggling with

Re: clean_() doesn't handle images?

2009-07-31 Thread Karen Tracey
On Fri, Jul 31, 2009 at 3:18 AM, Martje wrote: > > I don't understand, sorry :$. Do you care to explain a little bit > more? Or could you give an example? > > I'm using the admin interface btw. > You added a custom field clean method to your model definition. This

Re: How can I reload attributes from the database

2009-07-31 Thread Karen Tracey
On Fri, Jul 31, 2009 at 5:51 AM, Fleg wrote: > > Thanks for your suggestion, but I cannot... I need to do that from a > method of the model itself. > Basically, I need to use some stored procedures to modify datas in the > database (and these stored procs can also

Re: annotations only in 1.1 ?

2009-07-31 Thread gentlestone
thx (how stupid I am :-)) On 31. Júl, 14:17 h., Daniel Roseman wrote: > On Jul 31, 12:54 pm, gentlestone wrote: > > > I want find all instances of model KeyWord, where ManyToMany field > > categories is empty. I think in versieon 1.1 is the

Re: encoding problem

2009-07-31 Thread cootetom
You could try file_name.decode('utf-8', 'replace') which will tell the encoder not to throw errors but for any character it can't encode it will replace with a ? On Jul 31, 12:26 pm, alecs wrote: > Environment: > > Request Method: GET > Request >

Re: annotations only in 1.1 ?

2009-07-31 Thread Daniel Roseman
On Jul 31, 12:54 pm, gentlestone wrote: > I want find all instances of model KeyWord, where ManyToMany field > categories is empty. I think in versieon 1.1 is the appropriate code > like this: > > ... KeyWord.objects.annotate(cnt = Count(categories)).filter(cnt = > 0) ...

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Mirat Bayrak
thank you a lot, i am reading now --~--~-~--~~~---~--~~ 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

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Daniel Roseman
On Jul 31, 12:45 pm, Mirat Bayrak wrote: > > Do you mean you want the foreign key value to be the 'path' field of > > the Category model? You could do this, but why would you want to? If > > you ever want to refer to the category path from an Announce instance, > > you

Re: Finding a Django expert to review my code

2009-07-31 Thread Michelschr
Another approach: if you don't have it yet, start by writing tests, targeting a coverage of your code greater than 95%. Tests are very useful for a lot of reasons, specially to ease the evolution of your code... And in your situation, writing the tests will lead you to review your code by

annotations only in 1.1 ?

2009-07-31 Thread gentlestone
I want find all instances of model KeyWord, where ManyToMany field categories is empty. I think in versieon 1.1 is the appropriate code like this: ... KeyWord.objects.annotate(cnt = Count(categories)).filter(cnt = 0) ... What is the similar code in old version 1.0 for resolve the same result.

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Mirat Bayrak
i am little confused, may be i only create category_path on announce model and write path of selected category to there... it should work and simple :\ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Mirat Bayrak
> > > Do you mean you want the foreign key value to be the 'path' field of > the Category model? You could do this, but why would you want to? If > you ever want to refer to the category path from an Announce instance, > you just do: > announce.category.path > > hmm i have to explain more i

Re: encoding problem

2009-07-31 Thread alecs
Environment: Request Method: GET Request URL: http://172.16.23.33/file/4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d Django Version: 1.0.3 Python Version: 2.6.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions',

Re: encoding problem

2009-07-31 Thread Daniel Roseman
On Jul 31, 11:55 am, alecs wrote: > I'm sending a file to user: > > upfile = UpFile.objects.get(file_hash=request.path[6:]) >         user = get_object_or_404(User, username=request.user.username) >         down_file_log = DownFile.objects.create(user_id=user, >

Re: i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Daniel Roseman
On Jul 31, 11:25 am, Mirat Bayrak wrote: > I am working on a *Categories* application for my project. The model that i > need to categorize ise *Announces*.. i descibed category in announces like > this > > class Category >     ... >     ... >     path =

Re: Admin Customisations

2009-07-31 Thread Daniel Roseman
2009/7/31 Steven Church : > Daniel, > > Thank you for replying. I have finally found time now to start working on > this project again. I have the following. > > def viewlink(self, obj): > return 'View & Print' > viewlink.allow_tags = True > > and i have put

encoding problem

2009-07-31 Thread alecs
I'm sending a file to user: upfile = UpFile.objects.get(file_hash=request.path[6:]) user = get_object_or_404(User, username=request.user.username) down_file_log = DownFile.objects.create(user_id=user, file_id=upfile) wrapper = FileWrapper(file(upfile.file_path))

i need custom database behaviour, but i dont know how to do it

2009-07-31 Thread Mirat Bayrak
I am working on a *Categories* application for my project. The model that i need to categorize ise *Announces*.. i descibed category in announces like this class Category ... ... path = models.CharField class Announce: ... ... ... category =

Re: Create a web application

2009-07-31 Thread pallavi
hey susanne, sorry i could not help as i gave up that aplication. perhaps some one surely can help u here On Jul 31, 1:36 am, susanne wrote: > Hello Mr.pallavi, Mr.George and other members, > I have similar application like palavi. I followed this hints but not > success.

Thoughts on many-to-many relationship

2009-07-31 Thread prabhu S
Hi All, When I try to create a Group (django.contrib.auth.models.Group) dynamically, I get the below error. 'Group' instance needs to have a primary key value before a many-to- many relationship can be used. This is because I am trying to add permissions to the group object and trying to save

Re: How can I reload attributes from the database

2009-07-31 Thread Fleg
Thanks for your suggestion, but I cannot... I need to do that from a method of the model itself. Basically, I need to use some stored procedures to modify datas in the database (and these stored procs can also modify some other tables), thus I need to reload after calling these procedures in

Re: Finding a Django expert to review my code

2009-07-31 Thread Hernan Olivera
2009/7/31 Hernan Olivera : > 2009/7/31 Daniel Roseman : >> >> On Jul 31, 7:21 am, Rex wrote: >>> I just created my first Django site (as an academic research project). >>> Now that it is done, I would like to get feedback on

Re: Finding a Django expert to review my code

2009-07-31 Thread Hernan Olivera
2009/7/31 Daniel Roseman : > > On Jul 31, 7:21 am, Rex wrote: >> I just created my first Django site (as an academic research project). >> Now that it is done, I would like to get feedback on my code from a >> Django expert so that I can learn

Re: Finding a Django expert to review my code

2009-07-31 Thread Daniel Roseman
On Jul 31, 7:21 am, Rex wrote: > I just created my first Django site (as an academic research project). > Now that it is done, I would like to get feedback on my code from a > Django expert so that I can learn where I can improve as a Django dev. > How can I find

dynamic form

2009-07-31 Thread Salvatore Leone
Hi, I've got a form with various information and a file upload widget. Is there a way to uploads many files at the same time? So to have a link "add file" (and even "remove" file for already selected files). A possible way is to use some ajax framework (like jquery). So my questin is: do I

Re: Handle event on a django event Calendar

2009-07-31 Thread kimo
i tried but i have no calendar displayed, i have an error calendar() takes exaclty 3 arguments (1given) When i tried to put 3 arguments in my urls.py, nothing change. Thank you for help. On Jul 30, 2:19 pm, kimo wrote: > Thank you. > > I will have a look. > > On Jul

Re: clean_() doesn't handle images?

2009-07-31 Thread Martje
I don't understand, sorry :$. Do you care to explain a little bit more? Or could you give an example? I'm using the admin interface btw. On 31 jul, 01:45, Karen Tracey wrote: > On Thu, Jul 30, 2009 at 4:02 PM, Martje wrote: > > > Hey, > > > I've

Re: How to save a model...

2009-07-31 Thread zayatzz
Thanks Malcolm, I will test it when i get back home :) Alan On Jul 31, 9:46 am, Malcolm Tredinnick wrote: > On Thu, 2009-07-30 at 12:33 -0700, zayatzz wrote: > > ... Hello! > > > I have a model (profile) which's only required field is its foreignkey > > -

Re: "join" query in Django?

2009-07-31 Thread Malcolm Tredinnick
On Thu, 2009-07-30 at 23:42 -0700, Asinox wrote: > Thanks Malcom for replay, but, is not working for me, i think that is > simple just .filter("field1__field2"), but i cant make the join i try > with .filter("field1__field2") where the field1 is the PK and the > field2 is the FK. > > here is my

Re: How to save a model...

2009-07-31 Thread Malcolm Tredinnick
On Thu, 2009-07-30 at 12:33 -0700, zayatzz wrote: > ... Hello! > > I have a model (profile) which's only required field is its foreignkey > - django.contrib.auth.User. > > Following the example of forementioned model and its manager i created > manager for the profile: > > class

Re: "join" query in Django?

2009-07-31 Thread Asinox
Thanks Malcom for replay, but, is not working for me, i think that is simple just .filter("field1__field2"), but i cant make the join i try with .filter("field1__field2") where the field1 is the PK and the field2 is the FK. here is my query: p =

Re: Finding a Django expert to review my code

2009-07-31 Thread Parag Shah
Hi Rex, I am not a django expert (in fact I have just started working with Django about a month back), but I have been in software development for a while. Remote code review sounds like an interesting exercise. I will be glad to help you with the review, but with no prior promises on the

Re: Finding a Django expert to review my code

2009-07-31 Thread Ben Atkin
I'd probably try emailing some of the top Django developers. This seems like it would be a buyer's market, due to the job being short and fun for a dedicated Django dev. Don't hire a noob like me. ;) http://code.djangoproject.com/wiki/DevelopersForHire Ben On Thu, Jul 30, 2009 at 11:21 PM, Rex

Re: Finding a Django expert to review my code

2009-07-31 Thread Daniel Brown
Good evening Rex, I'm a beginner to Python and Django and I've found running my scripts through PyLint (http://pypi.python.org/pypi/pylint) to be very worth while. Regards, Daniel 2009/7/30 Rex : > > I just created my first Django site (as an academic research

  1   2   >