Django Model | Relationship question. Student->School Class

2015-12-21 Thread Pemby
With this code for example. class Students(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) classChoice1 = ? classChoice2 = ? classChouce3 = ? class Class(models.Model):

Re: Error while customising Django User

2015-12-21 Thread Web Architect
Hi, Thanks for your suggestion. Will try it out. Thanks. On Saturday, December 19, 2015 at 10:11:48 PM UTC+5:30, Abdoul Aziz Abdoulaye wrote: > > Hello, > You can use django monkey patching for adding additional fields to User > model > > for your case it will look like this. > >

Re: Error while customising Django User

2015-12-21 Thread Web Architect
Hi Tim, Thanks for your suggestion. Will go through the documentation and will try it out. Thanks. On Saturday, December 19, 2015 at 9:26:37 PM UTC+5:30, Tim Graham wrote: > > You could use a OneToOneField as described at >

Re: Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-21 Thread Mike Dewhirst
On 22/12/2015 4:22 AM, Tim Graham wrote: Hi Mike, see if the documentation at the bottom of https://docs.djangoproject.com/en/stable/topics/forms/formsets/#django.forms.formsets.BaseFormSet.can_delete helps. Yes it does. Thank you Tim. "If you call formset.save(commit=False), objects will not

Template filter like truncatewords that truncates on a sentence boundary?

2015-12-21 Thread Paul Souders
I’m looking for a template tag something like truncatewords that will truncate a string (usually: TextFields) on a sentence boundary (double newline, sentence punctuation etc.). I’d prefer to implement this as a

How do you approach unit testing for pluggable apps?

2015-12-21 Thread Nan
So far I usually just build a sample project that also serves as a demonstration of how to use the pluggable app, and use `manage.py test` to run the tests inside the pluggable apps test module. Is this the preferred method? Should a pluggable app's tests stand alone and be runnable outside

Re: Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-21 Thread Tim Graham
Hi Mike, see if the documentation at the bottom of https://docs.djangoproject.com/en/stable/topics/forms/formsets/#django.forms.formsets.BaseFormSet.can_delete helps. On Monday, December 21, 2015 at 4:00:36 AM UTC-5, James Schneider wrote: > > > > That is true. However, if commit was False

Re: TemplateDoesNotExist Again

2015-12-21 Thread Tim Graham
Could you check if it's still an issue on Django 1.9? There were several improvements to template loading in that release [1]. If it is, could you provide a sample project with the exact case to be improved? [1]

TemplateDoesNotExist Again

2015-12-21 Thread Arindam Pradhan
Hi I am new to django community, I want to file a bug regarding a problem similar to this . Also when I use *render* rather than *render_to_response* in *django 1.8*, I do not get a

Re: Por que Django não é tão popular quanto Ruby on Rails?

2015-12-21 Thread Daniel França
It has been answered a few times already https://www.reddit.com/r/webdev/comments/1yxav7/why_is_ruby_on_rails_more_popular_than_django/ https://www.quora.com/Why-is-Django-not-as-popular-as-Ruby-on-Rails Anyway, Django is quite popular as well :) Em seg, 21 de dez de 2015 às 14:25, Jan Palach

Ip forgering

2015-12-21 Thread monoBOT
We are building up a project on production, so the avoid ip forgering protocol is active. Untill now everything seems ok, the problem is that im getting some django errors because it is blocking some pettitions from the server external ip address, the range of ports is wide, pasting the error

Re: Por que Django não é tão popular quanto Ruby on Rails?

2015-12-21 Thread Jan Palach
It depends on the community, companies behind, and a lot of things. Popularity doesn't mean better tool to solve your problem. Sometimes I read, "Java runs in 3 billion devices", ok. But. Should I really use Java because 3 billion people are using? Django is very popular inside Python's ecosystem,

how to access SQLAlchemy to Django Model ?

2015-12-21 Thread Ramin Farajpour Cami
Basic Models (Django and SQLAlchemy): A basic Django model looks something like this: class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) The equivalent SQLAlchemy model with declarative base looks like this: from sqlalchemy

django mac_address

2015-12-21 Thread Parheto Toure
how to use mac_address field in django 1.9 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group,

Re: Admin debugging delete

2015-12-21 Thread James Schneider
> > Now I think about it, I suspect your way (and now my preferred way) might have been an innovation for Python 3? > > M I don't believe so. I didn't look, but I think that syntax goes back <= 2.6. Pretty sure I've used it in 2.4. I know I've been using it in 2.7 for years. As I mentioned, I'd

Re: Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-21 Thread James Schneider
> That is true. However, if commit was False that object wouldn't be deleted but it would still appear in the self.deleted_objects list. My concern - or more accurately lack of understanding - is that the object would remain in existence AND appear in the deleted list. This was precisely what