Re: project architecture question
On Nov 14, 2:44 pm, "Sells, Fred"wrote: > I build healthcare applications and the gov't regs require we log most > user access to patient info. > > Since I've only built one (rather large) Django app, my logging is in > the same DB as my data and I use decorators in views.py to log all > access. There is only one table in it's own schema that is used for > this. > > Now I'm building additional, functionally unrelated projects but would > like to use the same logging model. > > We use MySQL and have very low throughput and use several databases > (i.e. mysql schema's) on a single linux server. > > Since this is used by several unrelated applications, I would appreciate > some advice from more experienced developers on a good technique. > Please bear in mind that I'm the only Python/Django.SQL developer in my > organization so there is not the need to coordinate with multiple > independent teams.. > > Would you recommend: > a) Just duplicate the model definition in each app (i.e. move to > separate file and import it for DRY) and use the ".using() clause or a > db router? > b) Create a separate app, dedicated to this -- but what's the best way > to do a "cross app" reference > c) create a separate site dedicated to this -- then should I use a url > to pass it the logging data making it decoupled or is there a better way > > Any insight would be appreciated. As I said, I work solo at the office > so this is my only way to collaborate with other professionals. Fred; please post this in new thread and don't "hijack" an existing one. For more on Django mailing list etiquette, see: https://code.djangoproject.com/wiki/UsingTheMailingList -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
project architecture question
I build healthcare applications and the gov't regs require we log most user access to patient info. Since I've only built one (rather large) Django app, my logging is in the same DB as my data and I use decorators in views.py to log all access. There is only one table in it's own schema that is used for this. Now I'm building additional, functionally unrelated projects but would like to use the same logging model. We use MySQL and have very low throughput and use several databases (i.e. mysql schema's) on a single linux server. Since this is used by several unrelated applications, I would appreciate some advice from more experienced developers on a good technique. Please bear in mind that I'm the only Python/Django.SQL developer in my organization so there is not the need to coordinate with multiple independent teams.. Would you recommend: a) Just duplicate the model definition in each app (i.e. move to separate file and import it for DRY) and use the ".using() clause or a db router? b) Create a separate app, dedicated to this -- but what's the best way to do a "cross app" reference c) create a separate site dedicated to this -- then should I use a url to pass it the logging data making it decoupled or is there a better way Any insight would be appreciated. As I said, I work solo at the office so this is my only way to collaborate with other professionals. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Application decoupling - project architecture question
I wrote a simple app that may be useful for avatar management: http://bitbucket.org/kmike/django-generic-images/wiki/Home It's similar to django-tagging in aspect that images can be attached to any model using generic relations and then fetched in a few sql queries. Avatar-uploading view example can be found in another app (upload_main_image view): http://bitbucket.org/kmike/django-photo-albums/wiki/Home However it is easy to write your own view or extend your editProfileForm. On 8 авг, 00:29, Andrin Riietwrote: > Thanks for your replies, > > I read the book and indeed I found what I needed. > > For anyone who happens to read this and is wondering the same thing, > here's how it goes: > > You extend the base form class (eg editProfileForm), add the avatar > field to it and you use the new form class by passing it as parameter > to the view function that displays it ( the view functions should be > designed to accept such parameters). You pass the correct values for > the parameters in the urlconf. > And you can decouple the form handling code by putting it all in the > form.save() method (as opposed to the view function) - that way when > you extend the base form you can extend the form handling code as > well. > > Thanks everyone, > > Andrin > > On Aug 7, 5:08 pm, grElement wrote: > > > > > There is a good tutorial on this in Practical Django Projects > > >http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969 > > > It goes a bit more into theory that I found helpful. > > > On Aug 6, 8:07 am, Andrin Riiet wrote: > > > > Hi, I'd like to shed some light on the "the right way" to make > > > applications in django by an example and a few questions. > > > > Let's say that I have a 'users' application (acting as "user profiles" > > > on the built-in user authentication system) and I want to add an > > > avatar image feature to it. > > > I'd like to have the avatars in a separate application in case my next > > > project doesn't require them (this is the right way to do things i > > > guess?) > > > > Now I want to have the user to be able to upload an avatar image in > > > the "edit profile" form. The default edit-profile form is defined in > > > my 'users' application of course. I'd like to "add" the avatar feature > > > (form field) to it somehow. - This is part 1 of the problem > > > > The 2nd part is in the form handling: the request object is going to > > > contain form field values from 2 different applications, none of which > > > should be responsible for processing the other's forms. > > > > Obviously the 'avatars' application is dependent on the 'users' > > > application but the 'users' application should be oblivious of the > > > avatars... > > > > How would I go about doing that? > > > > Andrin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Application decoupling - project architecture question
I wrote a simple app that may be useful for avatar management: http://bitbucket.org/kmike/django-generic-images/wiki/Home It's similar to django-tagging in aspect that images can be attached to any model using generic relations and then fetched in a few sql queries. Avatar-uploading view example can be found in another app (upload_main_image view): http://bitbucket.org/kmike/django-photo-albums/wiki/Home However it is easy to write your own view or combine it with profile editing view. On 8 авг, 00:29, Andrin Riietwrote: > Thanks for your replies, > > I read the book and indeed I found what I needed. > > For anyone who happens to read this and is wondering the same thing, > here's how it goes: > > You extend the base form class (eg editProfileForm), add the avatar > field to it and you use the new form class by passing it as parameter > to the view function that displays it ( the view functions should be > designed to accept such parameters). You pass the correct values for > the parameters in the urlconf. > And you can decouple the form handling code by putting it all in the > form.save() method (as opposed to the view function) - that way when > you extend the base form you can extend the form handling code as > well. > > Thanks everyone, > > Andrin > > On Aug 7, 5:08 pm, grElement wrote: > > > > > There is a good tutorial on this in Practical Django Projects > > >http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969 > > > It goes a bit more into theory that I found helpful. > > > On Aug 6, 8:07 am, Andrin Riiet wrote: > > > > Hi, I'd like to shed some light on the "the right way" to make > > > applications in django by an example and a few questions. > > > > Let's say that I have a 'users' application (acting as "user profiles" > > > on the built-in user authentication system) and I want to add an > > > avatar image feature to it. > > > I'd like to have the avatars in a separate application in case my next > > > project doesn't require them (this is the right way to do things i > > > guess?) > > > > Now I want to have the user to be able to upload an avatar image in > > > the "edit profile" form. The default edit-profile form is defined in > > > my 'users' application of course. I'd like to "add" the avatar feature > > > (form field) to it somehow. - This is part 1 of the problem > > > > The 2nd part is in the form handling: the request object is going to > > > contain form field values from 2 different applications, none of which > > > should be responsible for processing the other's forms. > > > > Obviously the 'avatars' application is dependent on the 'users' > > > application but the 'users' application should be oblivious of the > > > avatars... > > > > How would I go about doing that? > > > > Andrin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Application decoupling - project architecture question
Thanks for your replies, I read the book and indeed I found what I needed. For anyone who happens to read this and is wondering the same thing, here's how it goes: You extend the base form class (eg editProfileForm), add the avatar field to it and you use the new form class by passing it as parameter to the view function that displays it ( the view functions should be designed to accept such parameters). You pass the correct values for the parameters in the urlconf. And you can decouple the form handling code by putting it all in the form.save() method (as opposed to the view function) - that way when you extend the base form you can extend the form handling code as well. Thanks everyone, Andrin On Aug 7, 5:08 pm, grElementwrote: > There is a good tutorial on this in Practical Django Projects > > http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969 > > It goes a bit more into theory that I found helpful. > > On Aug 6, 8:07 am, Andrin Riiet wrote: > > > Hi, I'd like to shed some light on the "the right way" to make > > applications in django by an example and a few questions. > > > Let's say that I have a 'users' application (acting as "user profiles" > > on the built-in user authentication system) and I want to add an > > avatar image feature to it. > > I'd like to have the avatars in a separate application in case my next > > project doesn't require them (this is the right way to do things i > > guess?) > > > Now I want to have the user to be able to upload an avatar image in > > the "edit profile" form. The default edit-profile form is defined in > > my 'users' application of course. I'd like to "add" the avatar feature > > (form field) to it somehow. - This is part 1 of the problem > > > The 2nd part is in the form handling: the request object is going to > > contain form field values from 2 different applications, none of which > > should be responsible for processing the other's forms. > > > Obviously the 'avatars' application is dependent on the 'users' > > application but the 'users' application should be oblivious of the > > avatars... > > > How would I go about doing that? > > > Andrin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Application decoupling - project architecture question
There is a good tutorial on this in Practical Django Projects http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969 It goes a bit more into theory that I found helpful. On Aug 6, 8:07 am, Andrin Riietwrote: > Hi, I'd like to shed some light on the "the right way" to make > applications in django by an example and a few questions. > > Let's say that I have a 'users' application (acting as "user profiles" > on the built-in user authentication system) and I want to add an > avatar image feature to it. > I'd like to have the avatars in a separate application in case my next > project doesn't require them (this is the right way to do things i > guess?) > > Now I want to have the user to be able to upload an avatar image in > the "edit profile" form. The default edit-profile form is defined in > my 'users' application of course. I'd like to "add" the avatar feature > (form field) to it somehow. - This is part 1 of the problem > > The 2nd part is in the form handling: the request object is going to > contain form field values from 2 different applications, none of which > should be responsible for processing the other's forms. > > Obviously the 'avatars' application is dependent on the 'users' > application but the 'users' application should be oblivious of the > avatars... > > How would I go about doing that? > > Andrin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Application decoupling - project architecture question
I'm far from being an expert, but maybe you can look at the django-tagging code for inspiration: http://code.google.com/p/django-tagging/ What they do is to provide a TagField in the tagging application, and then you can use that field in the form of the application using tags. You can probably do something similar with an AvatarField. - Paulo On Thu, Aug 6, 2009 at 4:07 PM, Andrin Riietwrote: > > Hi, I'd like to shed some light on the "the right way" to make > applications in django by an example and a few questions. > > Let's say that I have a 'users' application (acting as "user profiles" > on the built-in user authentication system) and I want to add an > avatar image feature to it. > I'd like to have the avatars in a separate application in case my next > project doesn't require them (this is the right way to do things i > guess?) > > Now I want to have the user to be able to upload an avatar image in > the "edit profile" form. The default edit-profile form is defined in > my 'users' application of course. I'd like to "add" the avatar feature > (form field) to it somehow. - This is part 1 of the problem > > The 2nd part is in the form handling: the request object is going to > contain form field values from 2 different applications, none of which > should be responsible for processing the other's forms. > > Obviously the 'avatars' application is dependent on the 'users' > application but the 'users' application should be oblivious of the > avatars... > > How would I go about doing that? > > Andrin > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Application decoupling - project architecture question
Hi, I'd like to shed some light on the "the right way" to make applications in django by an example and a few questions. Let's say that I have a 'users' application (acting as "user profiles" on the built-in user authentication system) and I want to add an avatar image feature to it. I'd like to have the avatars in a separate application in case my next project doesn't require them (this is the right way to do things i guess?) Now I want to have the user to be able to upload an avatar image in the "edit profile" form. The default edit-profile form is defined in my 'users' application of course. I'd like to "add" the avatar feature (form field) to it somehow. - This is part 1 of the problem The 2nd part is in the form handling: the request object is going to contain form field values from 2 different applications, none of which should be responsible for processing the other's forms. Obviously the 'avatars' application is dependent on the 'users' application but the 'users' application should be oblivious of the avatars... How would I go about doing that? Andrin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---