Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

settings assume pk=1 #9

Closed
jroo opened this issue Feb 3, 2012 · 7 comments
Closed

settings assume pk=1 #9

jroo opened this issue Feb 3, 2012 · 7 comments
Milestone

Comments

@jroo
Copy link
Contributor

jroo commented Feb 3, 2012

find a better way. don't rely on id, maybe enforce that only one setting record exists? possibly move settings out of database and into a file?

@rosskarchner
Copy link
Member

I considered suggesting settings move to settings.py-- although I admit being able to edit them in the Wordpress admin is a nice feature of RAMP.

I'd be on board for migrating them to settings.py or a separate file if you agree.

@jroo
Copy link
Contributor Author

jroo commented Feb 4, 2012

Yeah, I like the ability to edit them in admin, too. Is it safe to assume pk will always be 1? Will the admin enforce this? If not should we enforce that just one record exists no matter what the id and just grab it?

@rosskarchner
Copy link
Member

Right now admin does enforce it

On Feb 4, 2012, at 11:48 AM, Joshua Ruihleyreply@reply.github.com wrote:

Yeah, I like the ability to edit them in admin, too. Is it safe to assume pk will always be 1? Will the admin enforce this? If not should we enforce that just one record exists no matter what the id and just grab it?


Reply to this email directly or view it on GitHub:
https://github.com/jroo/django-nudge/issues/9#issuecomment-3811335

@jroo
Copy link
Contributor Author

jroo commented Feb 4, 2012

Nice. Does admin explicitly enforce that the id will always be 1 or does it just enforce one record (and the id could be anything)?

@rosskarchner
Copy link
Member

It doesn't acknowledge that other settings objects might exist: if you try to add one or look at the list, it does a get_or_create for pk=1, and redirects you to edit it

On Feb 4, 2012, at 2:19 PM, Joshua Ruihleyreply@reply.github.com wrote:

Nice. Does admin explicitly enforce that the id will always be 1 or does it just enforce one record (and the id could be anything)?


Reply to this email directly or view it on GitHub:
https://github.com/jroo/django-nudge/issues/9#issuecomment-3812501

@jroo
Copy link
Contributor Author

jroo commented Feb 4, 2012

Thanks fo the clarification. I'm closing this since settings should assume that pk=1.

@jroo jroo closed this as completed Feb 4, 2012
@rosskarchner
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants