Re: Mobile website using Django

2010-11-18 Thread het.oosten
I have implemented a mobile site according the instructions on this site: http://www.packtpub.com/article/multiple-templates-in-django Same approach on this site: http://tech.agilitynerd.com/conditional-mobile-web-site-redirect-in-djang A different template is loaded for mobile users. When a user

Re: Creating A Model For Existing DB Table

2010-11-18 Thread veeravendhan
Why do you want to create a models, better go with "inspectdb" will give you the models. check out this: http://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs -Veera On Nov 10, 10:23 pm, octopusgrabbus wrote: > I have an existing MySQL table. It's fairly straightforward: >

Re: mac No module named _md5 error

2010-11-18 Thread Adam V.
How did you install 2.6.6, and what does "which python" give 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+uns

Need help using ExtJS in Django

2010-11-18 Thread codingJoe
Newbie question here... I know the basics of Django and nothing of ExtJS. I am running a simple web framework and I want to integrate ExtJS Grid into it. My first step was to run the example grid from extjs. "Yay!! It works" Then I wanted to render that same working example inside my django ap

django-admin.py not functional on 64 bit Vista

2010-11-18 Thread michael11717
hi, "django-admin.py startproject myproject" is not functional on my 64 bit Windows Vista SP2 resulting in an "usage" error message: "Usage: django-admin.py subcommand [options] [args]" the "usage" error message would seem to indicate django-admin.py is indeed running, I believe that I have inst

Re: Where is everything on ubuntu 10.10

2010-11-18 Thread Kenneth Gonsalves
On Thu, 2010-11-18 at 06:10 -0800, sheeptick wrote: > The site-packages directory is empty, so where did django go? ubuntu guys have something called dist-packages -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Javier Guerra Giraldez
On Thu, Nov 18, 2010 at 6:08 PM, Victor Hooi wrote: > But  yeah, I'd still love if there was a separate template I could use > to generate the PDF. It just feels very weird building up the PDF line > by line in views.py. the obvious answer is "write your own"; but it doesn't have to be a full-fle

mac No module named _md5 error

2010-11-18 Thread MrPeabody
I'm a python & django newbie, so please excuse my ignorance when it rears its ugly head. I'm just trying to get django running on my macbook. I've got python --version = Python 2.6.6 and I just downloaded django stable release 1.2.3. I've been following the tutorial. When I did the > python man

Re: testing django applications

2010-11-18 Thread roberto
What if you add a __init__.py inside AAA directory and in your abc/ tests.py you include "from projectXXX.AAA.xyz import class_to_test" plus all the test code you want for testing it ? Good luck! Roberto On Nov 18, 12:05 pm, girish shabadimath wrote: > I will try out that ,, > > > > > > > > > >

Re: how to hide a field on

2010-11-18 Thread Jonas Geiregat
I've never seen Marcos's way of solving this. But I do it this way: First hide the field: class PostAdmin(admin.ModelAdmin): exclude=('registered_date') admin.register(Post, PostAdmin) And let a default value be filled in, in your models.py file: class Post(models.Model): t

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Victor Hooi
Hi: natebeacham: Yup, using item.category.name works fine =). Using string interpolation on item.category also works - I was silly, forgot to restart the gunicorn process (I suppose you have to restart it after any changes to views.py, right? Or does it pick it up automatically after a while?).

Re: Mobile website using Django

2010-11-18 Thread Tim Sawyer
If it helps, I've used iui and now jquery mobile with Django. http://code.google.com/p/iui/ http://jquerymobile.com/ Some random scribblings of mine on jQueryMobile here: http://drumcoder.co.uk/blog/2010/nov/12/jquery-mobile-basics/ Tim. On 18/11/10 20:51, Helge wrote: Hi I wish to develop

Mobile website using Django

2010-11-18 Thread Helge
Hi I wish to develop a website that is optimized for mobile using Django. Is there any "standard" mobile framework for Django? I've found a couple of Django projects [1] [2] [3] [4] that provide functionality needed for mobile development (like device detection, browser detection, WURFL). Does an

So, we're trying to hire a front-end Django developer (Kansas City, Missouri)

2010-11-18 Thread Alan Christopher Thomas
I'm a Django guy in Kansas City, MO, and work at a company called Liquid 9. Liquid 9 has its roots as a video company, in the entertainment industry.. music videos, etc. However, over the last year or so, the Interactive department here (consisting of Travis, the designer, and myself), has taken o

Re: how to hide a field on

2010-11-18 Thread Marcos Moyano
class PostForm(forms.ModelForm): registered_date = forms.DateTimeField(widget=forms.HiddenInput) class Meta: model = Post class PostAdmin(admin.ModelAdmin): form = PostForm admin.register(Post, PostAdmin) Rgds, Marcos On Thu, Nov 18, 2010 at 5:11 PM, Anderson Goulart wrot

Re: arbitrary ordering in a model

2010-11-18 Thread ringemup
Grappelli now has a drag-n-drop sorting option, but it only works for inlines. On Nov 18, 1:11 pm, Daniel Carvalho wrote: > Hi > I have some models where I want objects to be displayed in an arbitrary > order. > > For that I have in the model a number field, which is used to sort. > class MyModel

how to hide a field on

2010-11-18 Thread Anderson Goulart
Hi, Imagine that I have a simple model like this: import datetime class Post(models.Model): title = models.CharField(max_legth=100) desc = models.TextField() registered_date = models.DateTimeField(default=datetime.datetime.now) Now I want to use admin interface to fill

Re: Caching user and auth data

2010-11-18 Thread Joe Kondel
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions You'd want to use the write-through suggested by first configuring something like memcached, and then follow: "For persistent, cached data, set SESSION_ENGINE

arbitrary ordering in a model

2010-11-18 Thread Daniel Carvalho
Hi I have some models where I want objects to be displayed in an arbitrary order. For that I have in the model a number field, which is used to sort. class MyModel: ... class Meta: ordering = ["orderfield"] It would be cool if instead of editing this field, I have a "go up" and "go down"

Re: user defined settings via the admin

2010-11-18 Thread creecode
Hello garagefan, On Nov 18, 7:07 am, garagefan wrote: > what are our options to grant admin based settings? Obviously a model > called settings with perhaps it's own admin template to only allow/ > show a single entry into this model/db is possible. But should it > really warrant an additional d

Re: Using foreignkey data as a primary key

2010-11-18 Thread Rainy
On Nov 18, 9:04 am, JE wrote: > Hi, > > I'm pretty new to Django so feel free to laugh if something's > horrendously wrong here that I haven't spotted. > > I'm trying to use a field from a foreign key as a primary key in > another model, but have no idea how to do this. > The idea is to have a t

Re: Where is everything on ubuntu 10.10

2010-11-18 Thread sheeptick
Thank you for your reply. Yes, I was getting: django-admin.py: command not found. I've taken your advice and uninstalled django via aptitude, then installed the version that matches my book as a tar.gz django-admin.py now works, so I'm on my way. I'd still like to know where Django went, though! It

Re: Uploads outside of a form

2010-11-18 Thread AK
Well I found two solutions if anyone is interested. The first is a pure-Python way of doing it that is moderately successful. with BufferedReader( BytesIO( request.raw_post_data ) ) as stream: with BufferedWriter( FileIO( "/tmp/foo.bar", "wb" ) ) as destination: foo = stream.rea

Hierarchical groups

2010-11-18 Thread Tros Alba
I want to organize my groups hierarchically. How do I proceed? Sub class Group or create an another model? Thank you for your 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-us...@googlegr

Re: representing a possible future object in a form?

2010-11-18 Thread bobhaugen
On Nov 18, 12:18 am, Derek wrote: > It would be great if perhaps one of you could write up a more detailed > description (i.e with code) of this as a blog entry... or maybe a wiki page? Derek, before I posted the vague description above, I looked at my code for an example that is open source and

user defined settings via the admin

2010-11-18 Thread garagefan
having an application specific settings.py is a nice idea, in our world. In the real world websites seem to be managed by non-technical people... and ultimately we're not just building these applications for technologically "gifted" people. Settings should be defined with the admin for certain thi

Re: Using foreignkey data as a primary key

2010-11-18 Thread Jonas Geiregat
I myself am far from a django expert. But I think you should be using a ForeignKey Field. Because one Tag can be bound to more then one CurrentTag object, not ? Op 18-nov-2010, om 15:04 heeft JE het volgende geschreven: > class CurrentTag(models.Model): >tag = models.OneToOneField(Tag) > >

Re: Where is everything on ubuntu 10.10

2010-11-18 Thread Robbington
Hi Charlie, By "I can't run: django-admin.py startproject some_project" do you mean that you get an error message like bash: django-admin.py: command not found? If so this post might be helpful. http://groups.google.com/group/django-users/browse_thread/thread/52183f8deb34fea0?hl=en If its someth

Re: how to add poll app in Admin page

2010-11-18 Thread frank
Thanks everyone i will follow the new tutorial. and i have not created the admin.py with the correct contents.. thak a lot for the reply On Nov 17, 6:48 pm, frank wrote: > hi all > > i followed each step in tutorial to create poll app...i am able to see > the admin page...when i added the Admin c

Where is everything on ubuntu 10.10

2010-11-18 Thread sheeptick
Hi all, I'm fairly new to Linux, but learned some python on windows. I want to work through Ayman Hourieh's book on django. I'm having trouble finding stuff in order to set PATH and PYTHONPATH variables. I installed ubuntu 10.10, and used apt-get to install python2.6 and django. I can open a shel

Using foreignkey data as a primary key

2010-11-18 Thread JE
Hi, I'm pretty new to Django so feel free to laugh if something's horrendously wrong here that I haven't spotted. I'm trying to use a field from a foreign key as a primary key in another model, but have no idea how to do this. The idea is to have a table called Tag (columns called tagname and tag

Re: testing django applications

2010-11-18 Thread girish shabadimath
I will try out that ,, On Thu, Nov 18, 2010 at 6:47 PM, xvga wrote: > I guess one way would be to put xyz.py in own app. Remember though to > have models.py(empty is fine too) in the app dir > > On Nov 18, 2:27 pm, girish shabadimath > wrote: > > Thanks for the reply, > > but according to the

Re: testing django applications

2010-11-18 Thread xvga
I guess one way would be to put xyz.py in own app. Remember though to have models.py(empty is fine too) in the app dir On Nov 18, 2:27 pm, girish shabadimath wrote: > Thanks for the reply, > but according to the django > documentationhttp://docs.djangoproject.com/en/1.2/topics/testing/#writing-

Re: Generic relations

2010-11-18 Thread Jonas Geiregat
That was it! After running: ./manage.py sqlclear foo | ./manage.py dbshell && ./manage.py syncdb it works! So something in my db was inconsistent! Thanks! Op 18-nov-2010, om 09:57 heeft Marc Aymerich het volgende geschreven: > On Thu, Nov 18, 2010 at 12:00 AM, Jonas Geiregat wrote: >> >> Op

Re: Set Language in the Admin

2010-11-18 Thread Federico Capoano
Thanks On Nov 16, 11:19 am, Tom Evans wrote: > On Tue, Nov 16, 2010 at 9:58 AM, Federico Capoano > > wrote: > > This will affect the frontend too? > > Yes, I'd replace it with a customized version of the LocaleMiddleware, > something like this ought to do the trick: > > from django.middleware.lo

Re: testing django applications

2010-11-18 Thread girish shabadimath
Thanks for the reply, but according to the django documentation http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests test runner looks for tests only in models.py or tests.py of a specific application,,but

Re: Newbie: can't login as user via standard admin login page

2010-11-18 Thread John B
Hi, Not sure what you mean by a "normal user". If you want them to access the admin, make them staff. You can still control their ability to create/update/delete data through permissions. If you want them to be able to edit data but not necessarily access admin, maybe look into making a view that

Re: testing django applications

2010-11-18 Thread xvga
Hi Girish, why don't you put tests.py in the same dir where xyz.py is? On Nov 18, 11:52 am, girish shabadimath wrote: > Hi all, > > im working on a django project XXX, > > the directory structure is as follows: > > - project XXX >       -abc >          models.py >          views.py >          t

Re: Newbie: can't login as user via standard admin login page

2010-11-18 Thread Daniel Roseman
On Nov 18, 1:58 am, john doe wrote: > On Wed, Nov 17, 2010 at 5:48 PM, Thomas Schreiber wrote: > > Are you sure the user has been marked as is_staff or is_superuser? > > >http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth... > > No the user is not marked as either because it is

testing django applications

2010-11-18 Thread girish shabadimath
Hi all, im working on a django project XXX, the directory structure is as follows: - project XXX -abc models.py views.py tests.py urls.py +docs +libs +logs +thirdparty +corns - AAA xyz.py aaa.py setti

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Jirka Vejrazka
Hi Victor, It really depends on complexity of your PDF. I needed to do something similar some time ago and used ReportLab addon called "pisa" and used standard Django template language to define the PDF contents. You might want to take a look, it worked well enough for simple PDF pages. Ch

Re: Generic relations

2010-11-18 Thread Marc Aymerich
On Thu, Nov 18, 2010 at 12:00 AM, Jonas Geiregat wrote: > > Op 17-nov-2010, om 23:46 heeft Marc Aymerich het volgende geschreven: > > GenericPost.objects.get(pk=1).content_object.content > > > That's the strange thing. It just doesn't work: > > Some code: > > > In [3]: GenericPost.objects.get(