I have two models notes and counties which are used across multiple models.
At the moment the realtionship is done using a foreign key.
I am getting conflicting advice on whether to use a Generic Foreign Key.
Could someone please enlighen me as to the best practice?
Many thanks in advance
--
Generic Foreign Key solve a very specific problem. Foreign key to
arbitrary models. Like a tagging system, with the ability to set a tag
to user, article, comment, media in a blog.
For your use, as long as no models can link to notes or counties and
not both, simple foreign key are fine.
And even
Hi
Thanks for this.
So basically if I am using the county Foreign key in a few different models
I am fine. I am not sure what you meant by this
"as long as no models can link to notes or counties and
not both, simple foreign key are fine."
On 21 July 2016 at 11:13, ludovic coues wrote:
> Gener
Albert,
Yes, any other app , written in Python or any other language, should
be able to access your relational DB concurrently with your Django
app, if it has the right credentials. This is true for PostgreSQL,
MySQL, Oracle, DB2, or any other RDBMS you might
Hello!
For example, i extend User:
class ExtUserManager(BaseUserManager):
def create_user(self, email, password=None):
"""
Creates and saves a User with the given email, date of
birth and password.
"""
if not email:
raise ValueError('Users mu
Hello everyone!
For example, i have an extended User model:
class ExtUserManager(BaseUserManager):
def create_user(self, email, password=None):
"""
Creates and saves a User with the given email, date of
birth and password.
"""
if not email:
I was thinking of the case of one model which can have a foreign key
to one of two models.
Like a title model that can have a foreign key to a page model or an
article model.
2016-07-21 13:15 GMT+02:00 'David Turner' via Django users
:
> Hi
>
> Thanks for this.
> So basically if I am using the cou
Being a Django "newcomer" I am hoping someone can help us with this simple
problem.
We have a model for students containing names and email addresses. We want
them to subscribe to various newsletters.
Is it better to have a separate model for newsletters and how would we
produce the list for
Okay thanks for the clarification
On 21 July 2016 at 14:13, ludovic coues wrote:
> I was thinking of the case of one model which can have a foreign key
> to one of two models.
> Like a title model that can have a foreign key to a page model or an
> article model.
>
> 2016-07-21 13:15 GMT+02:00 '
--
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, send email to django-users@googlegroups.com.
input -> function == expected output
On Thu, Jul 21, 2016 at 4:37 PM, Seti Volkylany
wrote:
>
>
> --
> 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-u
https://docs.djangoproject.com/en/1.9/topics/db/examples/many_to_many/
Each student can subscribe to more than one newsletter
Each newsletter have many of students.
2016-07-21 15:20 GMT+02:00 Ant :
> Being a Django "newcomer" I am hoping someone can help us with this simple
> problem.
>
> We h
How get a total count pages in PDF file, created with using ReportLab,
without third-party apps and hardcode (or violation DRY)?
--
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, s
>
> NOT NULL constraint failed: auth_user.last_login
>
>
>
This is a new user. Why should it have a last_login value?
I coded around it by giving the new user a fictitious last_login value, but
still...
--
You received this message because you are subscribed to the Google Groups
"Django user
If you upgraded from Django 1.7 you should make sure to run all auth
migrations.
If you're using a custom user model make sure to makemigrations for its app
and proceed to migrate it.
Simon
Le jeudi 21 juillet 2016 11:46:37 UTC-4, bobhaugen a écrit :
>
> NOT NULL constraint failed: auth_user.l
Hah! You are right! My fault.
On Thursday, July 21, 2016 at 11:55:29 AM UTC-5, Simon Charette wrote:
>
> If you upgraded from Django 1.7 you should make sure to run all auth
> migrations.
>
> If you're using a custom user model make sure to makemigrations for its
> app and proceed to migrate it.
I'm trying to set up celery as a supervisord job (for my Django project)
and getting an error. Most likely it's because of wrong import paths (or
some other environment setting), but I have no idea what. Please help!
Here's my directory structure ('>' means down one level):
/home/ankush/jremind
If you are getting variables from the environment, supervisor that special
environment directive. The variables need to specified in the supervisor
conf file, such as:
command=/home/ankush/jremind/env/bin/celery --app=remind.celery:app worker
--loglevel=INFO
environment=PYTHONPATH=/home/ankush/jre
18 matches
Mail list logo