You are not logged in.

Change Language:

Freelancer? Consultant? Check out: WorkTrail - Time Tracking made easy
Profile for Conley Owens

Name Conley Owens
Email Address ccowens@vt.edu
AvatarUsers avatar
Posts10
  • Re: A way to use Enum mysql type in django model ?
    Board » Django » Models
    Check out this link:
    http://stackoverflow.com/questions/21454/specifying-a-mysql-enum-in-a-django-model

    You can't really do it in a djangoish way (without creating your own custom stuff as the answers suggest), and I would suggest that you just restrict it yourself in your views and forms.

    --- Last Edited by Conley Owens at 2009-10-23 16:45:54 ---
  • Re: One widget to control multiple fields
    Board » Django » Views
    I haven't quite seen a good example yet (post one if you have one), but I think that the correct way of handling this is with MultiValueField.
  • Re: Admin : call a method to fill in some fields automatically ?
    Board » Django » Middleware
    In urls.py, create a url like url(r'^imdbfill/(?P<id>\d+)/$', 'views.imdb_fill', name="imdb_fill")

    Then in views.py, create a method with the signature def imdb_fill(request, id, template_name="imdb_fill")

    From there you can use the id and do whatever you want. You are going to have to do your own research on what to do in your views.py method, but that should get you started.
  • Re: authentication and models
    Board » Django » Models
    I'm sorry I didn't understand what you were doing. Passing arguments to the form is currently being worked on:
    http://code.djangoproject.com/ticket/9150

    The milestone is set to 1.2, so until then, you should probably stop using generics (the create_object function) for this task and leave yourself a note to go back to generics when there is support for passing parameters to forms.
  • Re: Help me to present data in django?
    Board » Django » Templates
    If you have: data = {'sok': [1, 10] , 'sao': [1, 10],'sok&sao':[2,20] } and you put {'data': data} into the response,

    {% for key, val in data.items %}
    {{key}} {{val.0}} {{var.1}}
    {% endfor %}
  • Re: authentication and models
    Board » Django » Models
    When you create, try user=request.user.

    Also, you may want to check out django-authority.
  • One widget to control multiple fields
    Board » Django » Views
    I want to have a mapping widget that controls several different fields. It seems that in django there is a one-to-one relationship between widgets and fields. What should I do?
  • Re: Can't syncdb after adding django.contrib.gis
    Board » Getting Started » Setup and Configuration
    In order to use contrib.gis with postgres, you do not only need to install postgis, but create a spatial database as well.

    http://geodjango.org/docs/install.html#post-installation

    (This fixed the problem.)

    --- Last Edited by Conley Owens at 2009-10-14 12:57:12 ---
  • Re: parsing
    Board » Django » Python Programming
  • Can't syncdb after adding django.contrib.gis
    Board » Getting Started » Setup and Configuration
    Hi, I've done a lot of searching and I've found other people who have this same problem, but I have not found a solution. As soon as I add 'django.contrib.gis' to my installed apps and run ./manage.py syncdb, I get the following error:

    Traceback (most recent call last):
      File "./manage.py", line 28, in <module>
        execute_from_command_line()
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/__init__.py", line 352, in execute_from_command_line
        utility.execute()
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/__init__.py", line 306, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/base.py", line 192, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/base.py", line 219, in execute
        output = self.handle(*args, **options)
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/base.py", line 348, in handle
        return self.handle_noargs(**options)
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 54, in handle_noargs
        tables = connection.introspection.table_names()
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/db/backends/__init__.py", line 405, in table_names
        return self.get_table_list(cursor)
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/db/backends/postgresql/introspection.py", line 30, in get_table_list
        AND pg_catalog.pg_table_is_visible(c.oid)""")
      File "/home/conley/pinax-env/lib/python2.6/site-packages/django/db/backends/util.py", line 19, in execute
        return self.cursor.execute(sql, params)
    psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block


    I have postgis installed, and I can connect to the db with ./manage.py dbshell. What do I need to do to fix this?


Powered by Sphene Community Tools