0
1

I am trying to create a module that lets me add some "qualifications" for a user. I created these:

forum_modules/mcs/__init__.py (blank file)

forum_modules/mcs/models.py. Has this in it:

from django.db import models
from forum.models import User

class User_qualification(models.Model):
    class Meta:
        app_label = 'osqa'
        verbose_name_plural = "User Qualifications"
        verbose_name = "User Qualification"

associated_user = models.ForeignKey(User)    
    details = models.CharField(max_length=20)

def __str__(self):
        return self.details

If i run syncdb this table is not created. Also, I originally had a urls.py and views.py, but if I visited my url it showed page not found, so I'm not sure if my module is even being imported.

asked 05 Nov '10, 23:53

rsp's gravatar image

rsp
41661420
accept rate: 66%

edited 20 May '11, 03:17

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674

Check the logs. Due to the dynamic nature of modules, when they throw errors they are not loaded, and the errors are logged.

(06 Nov '10, 10:47) Hernani Cerq... ♦♦

Btw, at least in this code it seems to me that you have an indentation problem. The line verbose_name = "User Qualification" has an extra space before it.

(06 Nov '10, 10:48) Hernani Cerq... ♦♦

that must be the way i pasted it here, the indents are fine in my source. I looked at log/django.osqa.log.txt and it doesn't have any of my modules files listed there. If I run syncdb does it install my module model into the database? because there's no table in my db for my model. Or do I do that separately before osqa can start using my module?

(06 Nov '10, 11:43) rsp

@rsp, you'll have to do syncdb --allif you have south installed.

(06 Nov '10, 12:22) Hernani Cerq... ♦♦

How did this go in the end? Did you get qualifications working? Would you like to share more of the code, and/or point us at a demonstration of it?

(20 May '11, 03:27) Andrew_S ♦
1

@Andrew_S. My implementation is a somewhat specific application and I think wouldn't be useful for you. Additionally, my application isn't fully developed. However I hope it soon will be and then I intend to post the site and some technical info about what I did. Hopefully then I can be some help.

(22 May '11, 23:52) rsp

Lovely, thanks @rsp - I look forward to it

(23 May '11, 05:19) Andrew_S ♦
showing 5 of 7 show 2 more comments

so after looking at some of the other modules I realized it should be app_label='forum'. I had app_label='osqa'. Just so no one makes this same mistake, I got the incorrect setting from this reference: http://wiki.osqa.net/display/MODULES/How+Modules+Work. Its actually a helpful reference to get started, just a little old I think. After this change, the syncdb --all worked.

link

answered 06 Nov '10, 14:56

rsp's gravatar image

rsp
41661420
accept rate: 66%

When I visit http://wiki.osqa.net/display/MODULES/How+Modules+Work, it says, "Page level restrictions have been applied that limit access to this page." How does one gain access to that documentation?

(15 May '11, 20:45) Anton Gerasc...

Nice to see you again, @Anton. The page you refer to contains obsolete and deprecated content. There is no publicly available content to replace it.

(15 May '11, 20:54) rickross ♦♦

Wiki page is not accessible, access blocked.

(18 Dec '11, 09:59) nilayparikh
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×24
×13
×11
×6

Asked: 05 Nov '10, 23:53

Seen: 867 times

Last updated: 18 Dec '11, 09:59

powered by OSQA