Member Avatar for greenleafone7

I have a 'User' model holding some information like username password etc.
After installing swingtime I was hoping to correlate its 'Event' model with my 'User' model so I can add events for every individual user.
The thing is that in order to do that I need to have a ForeignKey in 'Events'. But that model comes from a package I installed so I am not sure how to proceed.
Any ideas?

Recommended Answers

All 8 Replies

RTFM? What package? Where is the documentation for it? What is "ForeignKey" supposed to refer to? IE, until you produce your code, we can't help you very much. Also, we don't do your homework for you.

Member Avatar for greenleafone7

It says swingtime twice, so the package is swingtime.

If there was any decent documentation I would not be asking, I am basicaly hoping to stumble uppon someone with experience in django.

If you dont know what a "ForeignKey" is then please dont answer.

My issue has no need for code, I am not trying to fix a bug, I am asking something quite specific. More theory rather than coding.

Again what I am asking is quite specific and of the type "How can this be done" because there is no documentation anywhere and I do not have the experience to do it myself. Posted in a site where users ask and answer questions. How did you deduce homework out of that I do not know.

The documentation appears to live here. I think you want something impossible. There is nothing about allowing a foreign key in an event (apart from the event type).

The only field allowing you to connect the event to anything else is the Note field, which permits to store a string.

Member Avatar for greenleafone7

Hi Gribouillis, so basically you are saying that there is no way to implement events for each user separately? Thats too bad, but at least clears up the fact that swingtime is of no use to me.
Also I knew about the link you posted, but maybe because I am not very experienced with this, it was of no use to me.

It is the first time I see this swingtime module, so I may be wrong, but I'm pessimistic here :)

Member Avatar for greenleafone7

Can you imagine anything similar, for achieving a correlation between events and users, or would I have to create it myself?

You could add a user_event table which rows would contain a rowid and 2 foreign keys.

Member Avatar for greenleafone7

I will probably have to stop randomly typing and actualy design te relations I suppose.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.