Changes between Version 6 and Version 7 of IrcFAQ
- Timestamp:
- Feb 20, 2007, 8:41:02 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IrcFAQ
v6 v7 30 30 == How do I extend a model? I want to subclass django.contrib.auth.models.User. == 31 31 32 Can't do that right now, sorry. More: http://code.djangoproject.com/wiki/ModelInheritance 32 Not at the moment, but model subclassing is being worked on. 33 33 34 34 == If I change my model, will {{{manage.py syncdb}}} update my database table? == 35 35 36 No . Sorry. You will have to do this manually. If you are not bothered about losing data, just do an sqlreset. Otherwise do this: Before changing the model, do {{{ python manage.py sqlall yourapp > old.sql }}}, then change your model and do the same {{{ sqlall yourapp > new.sql }}} compare the two files and you will see the difference that you will need to script for this.36 No, you'll need to manually change your database table. If you use `manage.py sqlall` on your app to produce a SQL file before editing your models, you can run it again afterwards and use the difference between the two to see what you need to change in the database. 37 37 38 38 == What should I use for development -- the built-in server, mod_python, FastCGI? == … … 42 42 == What's the difference between {{{null=True}}} and {{{blank=True}}} in models? == 43 43 44 {{{null=True}}} tells Django that the DB schema should allow the storage of nulls in that field. {{{blank=True}}} indicates that the field is optional (e.g. the admin will not complain if you leave it blank).44 `null=True` means that the database will accept a `NULL` value for that field; `blank=True` means that Django's validation system won't complain about a missing value. If you use `blank=True` but ''not'' `null=True` you will need to have your code fill in a value before storage in the database -- specifying a default on a field, or putting something in the model's `save` method to generate a value are two good ways to handle this, and can be extremely useful when you want to calculate one field's value based on others. 45 45 46 46 == I think Ajax is awesome! How do I do Ajax with Django? ==