Re: installation invisible
pip is a python program, it will install python packages in to the site installation directory of the python it is run with. Therefore, if it is not installing packages where you want, make sure you are running pip with the python that you want to use the package with. It's actually what I did but I did act dumb following the django website instructions at the letter : I put 'sudo' before "pip install..". So everything is in place now as pythonbrew is in my home.. ^^ Thanks a lot. -- “One original thought is worth a thousand mindless quotings.” “Le vrai n'est pas plus sûr que le probable.” Diogene Laerce -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52536E87.2060804%40yahoo.fr. For more options, visit https://groups.google.com/groups/opt_out.
django model(s) silently fails to sync to the DB ( for no apparent reason )
I don't think I'm making a rookie mistake, I've looked over my code several times. I've got two pretty simple django models that are just failing to sync to the db during the syncdb there are no errors, even with --verbosity 3 When I try to make a relation to them I get an error saying the models either don't exist or a re abstract In fact when I examine the DB, they are not there. syncdb is attempting to sync models before and after these 2 models in the same file. I've dropped my DB and started from scratch several times I don't know how to debug this issue because I don't know how syncdb works under the covers and what can go wrong. Here are my models, they look pretty simple to me: class DirEnumVal(models.Model): str_val = models.CharField(max_length=64, default='') def unicode(self): return self.str_val class DirAttr(models.Model): BOOL = 'BOOL' MONO = 'MONO' SCAL = 'SCAL' ENUM = 'ENUM' TYPES = ( (BOOL,'Boolean'), (MONO,'Monomial'), (SCAL,'Scalar'), (ENUM,'Enumeration'), ) val_type = models.CharField(max_length=4, choices=TYPES) val_key = models.CharField(max_length=32) default_bool = models.BooleanField(default=True) default_num = models.IntegerField(default = 0) default_float = models.FloatField(default=1.0) enum_choices = models.ManyToManyField(DirEnumVal, null=True, blank=True) default_choice = models.CharField(max_length=64, default='') required = models.BooleanField(default=True) def unicode(self): return '{k} :=> {t} ( default = {d} )'.format( k=self.val_key, t=self.val_type, d=self.default()) I am using a pattern with multiple model files for a single app my dir structure is: >app > models - __init__.py - model_file1.py - model_file2.py and in my __init__.py I've got code to pull all the models together into one module: app.models from __future__ import absolute_import from .model_file1 import model1a,model1b,model1c from .model_file2 import model2a,model2b,model2c This way of importing the models has been working long before this trouble of models not being synched came up. When I access the django project and settings through a python shell I can import the models and instatiate them but when I save them, PostGres gives me this error: DatabaseError: current transaction is aborted, commands ignored until end of transaction block This problem surfaced after I installed django-categories and set up some category models. I had some trouble at first setting that up but I've got the BaseCategory subclasses behaving nicely now and have started with a fresh DB. At some point when I was getting django categories to work there was an error when I synched the DB that said something about an unexcepted special character being somewhere in my code or the django-categories code. That seemed suspicious but that doesn't show up anymore and I'm using a fresh DB. Does anybody see anything obvious or know what type of problems can cause syncdb to ignore models? I'm running out of ideas about what is wrong I'm on Django 1.5 using PostGreSQL & MacOS Lion Best Doug -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/feb8a865-7223-4876-8764-966ac837e609%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Access the AdminSite object by its name
Hi. When using multiple admin sites, it's necessary to give them (except the default one) a name to be able to reverse URL names correctly. The default admin site's name is 'admin'. https://docs.djangoproject.com/en/1.5/ref/contrib/admin/#multiple-admin-sites-in-the-same-urlconf Is it possible to get the admin site object (instance of django.contrib.admin.AdminSite) by it's name? I have some ideas to do this, but all of them are too ugly and convoluted. Thanks -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/65c14f66-b70f-400d-9be6-f5bd3fc313ac%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: uptodate Account_balance
Hi Maurice, its very hard understood this but i give a try. if your are working in finance-world you will need update de balance, so it implies fields 'depends' from others transactions, you named deposits/withdraws. You can use aggregations[1] or update field 'manually'. Regards, [1] https://docs.djangoproject.com/en/1.6/topics/db/aggregation/ On Thu, Oct 3, 2013 at 2:09 AM, MAurice wrote: > Hello everyone was requesting for help on this micro-finance software am > developing, needed to make the account balance reflect updated > amount/value on the database when deposits/withdraws are made on either the > account or loan repayment > > *class Branch(models.Model):* > time_stamp =models.DateTimeField(default=datetime.datetime.now(), > editable=False) > name =models.CharField(max_length=200) > physical_location=models.CharField(max_length=200) > email=models.EmailField() > > *class Account(models.Model):* > account_type=models.CharField(max_length=200, choices=ACCTYPE) > branch=models.ForeignKey('Branch') > first_name=models.CharField(max_length=200) > last_name =models.CharField(max_length=200) > account_number =models.SlugField(unique=True) > account_current_balance =models.FloatField(max_length=255,default=0) > * > class Account_holder(models.Model):* > id =models.IntegerField(primary_key=True,default=1) > account_id =models.ManyToManyField(Account) > > > * > > class Loan(models.Model):* > id = models.AutoField(primary_key=True,default=1) > branch_cod=models.IntegerField(blank=True, null=True) > time_years=models.DecimalField(default=1.0, max_digits=10, > decimal_places=4) > loan_number =models.SlugField(unique=True) > account_name=models.ForeignKey(Account) > loan_amount=models.DecimalField(default=0.0, max_digits=10, > decimal_places=2) > interest_rate=models.DecimalField(default=0.0, max_digits=10, > decimal_places=2) > interest_charged = models.DecimalField(default=0.0, max_digits=10, > decimal_places=2, editable=False) > required_payement = models.DecimalField(default=1.0, max_digits=10, > decimal_places=2) > * > class statement(models.Model):* > account_id =models.ForeignKey(Account) > date = models.DateTimeField(default=datetime.datetime.now(), > editable=False) > deposit = models.PositiveIntegerField(null=True, default=0) > withdraw = models.PositiveIntegerField(null=True, default=0) > description =models.TextField(max_length=200) > current_balance = models.FloatField(max_length=200, editable=False) > > def save(self, *args, **kwargs): > self.current_balance = self.account_id.average_balance + > self.credit - self.debit > self.average_balance = self.account_id.average_balance + > self.credit - self.debit -self.minimum_balance > super(statement,self).save(*args, **kwargs) > * > class Savant_user(models.Model):* > user =models.OneToOneField(User) > branch =models.ManyToManyField('Branch') > > > > def create_Dashboard_user_callback(sender, instance, **kwargs): > Dashboard, new = Savant_user.objects.get_or_create(user=instance) > post_save.connect(create_Dashboard_user_callback, User) > > -- > 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. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/585a5845-9111-492d-a0c9-10342ee2bfbc%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- Cristian Salamea @ovnicraft -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B16coMPWmHCaAkL6o9JbnazdC_8NSr7S-AipAbpAVTyzgKHOw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: uptodate Account_balance
On Monday, 7 October 2013 18:07:49 UTC+1, MAurice wrote: > needed to no how to have a uniform account_balance figure(after > withdraw or deposit) > > On 10/7/13, Maurice J Elagu > wrote: > > The signals are doin the notifications but not updating > > Please learn how to ask a question properly, and take some time to think about how you're asking it. Given just the information in the last two posts of yours, there is no way that anyone can help you at all. Please provide details of what you're experiencing, show some code and any errors, and explain how things are supposed to work. -- DR. -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5a00dd9d-78f8-4971-b6f5-9b1a1c788b07%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: PyCons in Africa
It would be wonderful if this could be done. My question is: can it be done? The most populous nation in Africa (and therefore, we must presume, the one with the most Python programmers) is Nigeria. Getting an entrance visa here -- even a tourist visa -- is a challenging thing. It's not required for citizens of nearby nations, but really a pain for Europeans or Americans. Airline tickets are expensive, even on European wages. Most locals could not afford a ticket. One wonders whether their employers can. If a suitable venue can be found in a more visitor-friendly nation, can enough attendees get there to be worthwhile? I am not saying "don't try" but there are some hurdles to overcome. I have joined the mailing list and will help out if I can. -- Vernon Cole eHealth Africa .org On Friday, October 4, 2013 5:13:44 PM UTC+1, Daniele Procida wrote: > > First of all, apologies if you have to read this more than once because of > the cross-posting. > > I've had an idea brewing recently. > > I went to meet Professor Judith Hall this afternoon to talk about it. > She's involved with http://medicine.cardiff.ac.uk/mothers-africa/(amongst > other things) and is working on a Cardiff University project which > itself is part of > http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en > > Following that meeting, I bashed out: > https://github.com/evildmp/pycons-in-africa/ - please take a look, and > even better, let me know what you think, or make your own contribution to > the document. I'll continue working on it myself. > > Thanks, > > Daniele > > -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9a8749dd-73e8-4c9e-b406-a5825860be67%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: uptodate Account_balance
needed to no how to have a uniform account_balance figure(after withdraw or deposit) On 10/7/13, Maurice J Elagu wrote: > The signals are doin the notifications but not updating > > > On 10/3/13, C. Kirby wrote: >> Use signals: >> https://docs.djangoproject.com/en/dev/topics/signals/ >> >> post_save check the amount deposited or withdrawn and update the balance >> >> On Thursday, October 3, 2013 9:42:48 AM UTC-5, MAurice wrote: >>> >>> Am creating this project in that a client has an account in a >>> micro-finance and can also Take Loans which loan is credited onto this >>> very >>> account. >>> The problem is am trying to find a way of having an Account_balance >>> which >>> >>> will be changing when deposits and withdrawals are made to the account >>> and also when loan payments are made. These are supposed to be reflected >>> on the account statement. am having issues with this account_balance >>> being >>> >>> updated >>> Thanks >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Django users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/django-users/_RIPOaIO6S8/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/a13ccfd8-d34d-42a2-88ea-54d687e806b9%40googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> > -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJoucbW5sMRcasTDqK2bmaVWMMHmKXf8vYQRP2XXTiGOfbKWOw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: uptodate Account_balance
The signals are doin the notifications but not updating On 10/3/13, C. Kirby wrote: > Use signals: > https://docs.djangoproject.com/en/dev/topics/signals/ > > post_save check the amount deposited or withdrawn and update the balance > > On Thursday, October 3, 2013 9:42:48 AM UTC-5, MAurice wrote: >> >> Am creating this project in that a client has an account in a >> micro-finance and can also Take Loans which loan is credited onto this >> very >> account. >> The problem is am trying to find a way of having an Account_balance which >> >> will be changing when deposits and withdrawals are made to the account >> and also when loan payments are made. These are supposed to be reflected >> on the account statement. am having issues with this account_balance being >> >> updated >> Thanks >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Django users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/django-users/_RIPOaIO6S8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/a13ccfd8-d34d-42a2-88ea-54d687e806b9%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJoucbX95XVG%2Bwj3dBDSD260kZ5qg3GR9zu-hiDAh1LT%2BXhhTg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: django-registration: extending the user model
If you mean that the User model doesnt have fields you may want, like telephone or address i.e., the best and easiest way is to use add a UserProfile model with a foreignkey to the User model. Django-profiles is one and it's meant for use with django-registration> https://bitbucket.org/ubernostrum/django-profiles On Sunday, 6 October 2013 16:43:57 UTC+2, +Emmanuel wrote: > > Hi, > I am looking for a comprehensive tutorial on how I can extend the default > user model using django-registration, specifically for Django 1.5 and > django-registration 1.0 > Thanks! > -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/99fc23b6-7fc1-465d-8a94-5d710dbbca27%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
ModelMultipleChoiceField ignore invalid choices?
Hi, I am using a ModelForm with a ModelMultipleChoiceField. I would like for this field to silently ignore invalid choices instead of creating a form error. Here is my use case: * User A opens form select model choice 1, 2, and 3 * User B (different browser) deletes model choice 3 entirely from system * User A submits form and receives error I understand why this should be an error in the general case, but in my case, I want this to silently ignore the invalid choice 3 and continue with choice 1 and 2? Is this possible? Thanks, Jon -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADhq2b5R3owKd%3D%3DGAeJpJD8UBaG4xyq13%2B0mKT%2BXCyeUSckTQA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: installation invisible
pip is a python program, it will install python packages in to the site installation directory of the python it is run with. Therefore, if it is not installing packages where you want, make sure you are running pip with the python that you want to use the package with. Cheers Tom On Mon, Oct 7, 2013 at 2:50 PM, Diogene Laerce wrote: > Hi, > > I installed django through pip : > > __ > Downloading/unpacking Django==1.5.4 > Downloading Django-1.5.4.tar.gz (8.1Mb): 8.1Mb downloaded > Running setup.py egg_info for package Django > warning: no previously-included files matching '__pycache__' found under > directory '*' > warning: no previously-included files matching '*.py[co]' found under > directory '*' > Installing collected packages: Django > Running setup.py install for Django > changing mode of build/scripts-2.6/django-admin.py from 644 to 755 > warning: no previously-included files matching '__pycache__' found under > directory '*' > warning: no previously-included files matching '*.py[co]' found under > directory '*' > changing mode of /usr/local/bin/django-admin.py to 755 > Successfully installed Django > Cleaning up... > __ > > But I actually use pythonbrew for python 2.7.5 and pip installed it for > the system which is python 2.6.6. > > How can I install it for the correct version (2.7.5) ? > > Thank you > > -- > “One original thought is worth a thousand mindless quotings.” > > “Le vrai n'est pas plus sûr que le probable.” > > > Diogene Laerce > > -- > 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. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/5252BC29.6060100%40yahoo.fr. > For more options, visit https://groups.google.com/groups/opt_out. -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1LDYQE6MK2xesCAO_D6wAcrLxe66E0RHLw041CVq%3Do5hg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: logic problem
On Mon, Oct 7, 2013 at 11:54 AM, Leonardo Giordani wrote: > Are you sure that your DB contains only one entry with that name? > Try printing it in the view you use to render that template and check the > output of the development server. Yes not getting you here ..:( -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB0GQhD96XPO6ecc8WGjsb-8nsMmTdWs4kqu8_%3Dp5A%2B_%3DiG7GA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
installation invisible
Hi, One option would be to set your pythonbrew install in your path. Or Execute pip using the absolute path to your python install. Either way you will still need to set your path. -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/95e24bba-c51a-4688-ae57-e1f47a50ae6a%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
installation invisible
Hi, I installed django through pip : __ Downloading/unpacking Django==1.5.4 Downloading Django-1.5.4.tar.gz (8.1Mb): 8.1Mb downloaded Running setup.py egg_info for package Django warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Installing collected packages: Django Running setup.py install for Django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' changing mode of /usr/local/bin/django-admin.py to 755 Successfully installed Django Cleaning up... __ But I actually use pythonbrew for python 2.7.5 and pip installed it for the system which is python 2.6.6. How can I install it for the correct version (2.7.5) ? Thank you -- “One original thought is worth a thousand mindless quotings.” “Le vrai n'est pas plus sûr que le probable.” Diogene Laerce -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5252BC29.6060100%40yahoo.fr. For more options, visit https://groups.google.com/groups/opt_out.
Writing translatable static web pages
Hello, I am a bit confused on the best way to handle this problem: My web site needs read-only static web pages (typically the About part of a web site) with 2 simple constraints: - they need to be translated - they need to have flexible layout: to incorporate base headers/footers, floating images and/or tables, and non-interactive elements (like a bootstrap carousel). Several solutions that I have thought about: - I can of course directly write HTML files but the translation part will be awkward (a lot of , , and which are of no interest to the translator). - I can use Django flatpages with some markup languages but I lose a lot of flexibility (for instance template tags are not recognized) - Use generators like Hyde, but it seems quite overkill for my needs. Does someone have other propositions that I can look into ? Is Textile the best markup language if I want tables and floating element and the ability to add custom Bootstrap class ? Thanks ! -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a2f2dcee-967e-4e4c-94b9-574b862fa804%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Copy all the data from an existing database when create the testing database.
Thanks Kelvin, I will have a look at this. It seems interesting. Kelvin Wong writes: > Consider using model factories (you can roll your own) or FactoryBoy > > https://factoryboy.readthedocs.org/en/latest/ > > K > > > On Friday, October 4, 2013 9:17:51 AM UTC-7, Tianyi Wang wrote: >> >> Yes, it'd be nice to have all the data from the existing database. >> I am aware the loading fixtures way, but I will need to do that every time >> I know the existing database has changed a lot. >> So just copy the data when creating the test database seems more >> convenient. >> >> Tianyi >> >> On Friday, 4 October 2013 17:08:02 UTC+1, C. Kirby wrote: >>> >>> Do you always want all of the data from the existing database, or is this >>> just a quick way to have "real data" for testing. >>> If it is the latter I would use manage.py dumpdata to generate test >>> fixtures. You can load the fixtures in you tests as needed. >>> >>> Chaim >>> >>> On Friday, October 4, 2013 8:48:45 AM UTC-5, Tianyi Wang wrote: Hi, When I run my tests, I'd like it to copy an existing database with all the data when create the testing database. I never thought about this till one of my colleague uses POSTGIS_TEMPLATE = DATABASES['default']['NAME'] for his tests. Because we use GeoDjango for our project, so POSTGIS_TEMPLATE exists for letting the test runner know which postgis database template to use. And when he define it as mentioned above, it actually creates the test database with all the data as well. It's kinda handy for us, so we don't need to create the fixture files. But if we can not do the same with the projects which do not use GeoDjango. So I have two questions here: 1. Is it good idea to use the data already exists in the project database? (For some tests, I may need to delete all the data first for a certain table, but in many cases, we test against non empty data set.) 2. If it's not a bad idea, for the project which does not use GeoDjango, is there anyway I can set it to copy the data from the existing database? Thanks Tianyi >>> -- Tianyi -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/87eh7xnxk3.fsf%40luffy.net. For more options, visit https://groups.google.com/groups/opt_out.
Re: image display in admin
On Monday, October 7, 2013 6:24:54 AM UTC+2, Harjot Mann wrote: > > On Sun, Oct 6, 2013 at 5:57 PM, Harjot Mann > > > wrote: > > I am uploading an image in my app and I want to display that image in > > admin site. What should I do? > > > http://www.acedevs.com/blog/2011/07/11/django-admin-list-view-thumbnails/ > I followed this link but it does not work. Help me please. > Apparently you missed something, but you only showed a tiny bit of the relevant code. That, or that example is sufficiently outdated that it no longer works like that (It is 2 years old). Did you add 'slide_thumbnail' to your list_display set? Did you register your custom Admin class? Did you remove the pyc file? -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1635989c-f1cd-4a2a-8434-98798e991108%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: proper way to override text plugin widget
wrong list, sorry :-( On 10/07/2013 11:23 AM, Roberto López López wrote: > Hi, > > The users of my project prefer ckeditor, so I am wondering how to use it > for cms.plugins.text . I am already making use of django-ckeditor in > other parts of the application. Can anyone enlighten me please? > > Thanks, > > Roberto > > -- Roberto López López System Developer Parallab, Uni Computing +47 55584091 -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52527E23.2080102%40uni.no. For more options, visit https://groups.google.com/groups/opt_out.
proper way to override text plugin widget
Hi, The users of my project prefer ckeditor, so I am wondering how to use it for cms.plugins.text . I am already making use of django-ckeditor in other parts of the application. Can anyone enlighten me please? Thanks, Roberto -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52527D84.7020301%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: 403 Forbidden messages when saving items in django-admin
On Sunday, October 6, 2013 8:24:20 PM UTC+2, Daniel Roseman wrote: > > Notice that this is the default Apache error message, not one for Django. > That strongly suggests that people are being redirected away from your > Django server to another, different one. Perhaps Django is running on a > non-standard port, and after saving they are being redirected to the > default port 80? > Both the website and the admin interface run at standard port 80. I thought that perhaps the issue might be the other way around, that people are being redirected away from the standard port to a different one or to a differetn virtual host on the same server, but where would such a thing occur? Remember, this is only happening in the contrib admin module. I've looked through my models.py, views.py and admin.py scripts (not sure where to look in this case), but I don't seem to explicitly redirect people anywhere. The only redirection taking place are some raise Http404 calls in my views.py, but those are on the normal website part of the code - I don't see how those would get called from the admin module. I think that for this theory that only leaves the possibility that some other error is triggering an error page from Apache directly and that that error gets redirected to a location we don't have access to? I do have error pages for Http 404 and 500. I tested one of those raise Http404 cases on the website (not the admin module), and I get a "normal" Django Http 404 message (the site is in DEBUG mode atm). I've traced the request/response headers leading up to those 403 Forbidden errors, but nothing jumps out - everything seems to be going on inside of our domain. Now I'm wondering: What would happen if Django did get upgraded from 1.1 to 1.2, 1.3 and finally 1.4, but the admin contrib module didn't get upgraded all the way to 1.4? Would it work at all? Could that explain these errors? AFAIK, the site is being hosted on Debian Linux (I expect it's the latest stable version, whether they call that Lenny or Harry or Boogy I don't know). Are django and admin contrib packages "linked" in their repository, so that if the base package gets upgraded, so does the dependant package? (I'm not too familiar with Linux and their distro's, more of a BSD man myself) Thanks for the suggestions so far. -- 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. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/831e860a-478e-4f3d-b294-8143bd0f5c46%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.